Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Pycharm django template replace patterns:
- Anchor tag search-replace patterns:
- search:
- href="/static/(?<url>.*)"
- replace:
- href="\{\% static '${url}' \%\}"
- Image tag search-replace pattern:
- search:
- src="/static/(?<url>.*)"
- replace:
- src="\{\% static '${url}' \%\}"
- UPDATE: pattern encompassing both:
- search:
- (?<type>href\s*=|src\s*=)\s*(?<quote>[\"\']).*static/(?<url>[^'"]*)\k<quote>
- replace:
- ${type}"\{\% static '${url}' \%\}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement