PyCharm. Regular expression to replace all script src attributes
I need to refactor my existing django code using a tag {% static 'path/to/file' %}
. I think it is possible to use PyCharm's "Replace in Path" function with the regex option.
So, I need to replace the script tags that now look like this:
<script type="text/javascript" src="/static/js/script.js"></script>
To look like this:
<script type="text/javascript" src="{% static 'js/script.js' %}"></script>
Here is the "Replace on the way" picarma window:
I think I need to pass "Text to find" something like src="([^"]+)"
, but what should I pass in "Replace with" I can't figure out.
Thanks in advance.
+3
source to share