I want to change this below using Regular Expression
<script type="text/javascript" language="javascript" src="/Common/Scripts/UserControls/Form.js"></script>
<script type="text/javascript" language="javascript" src="<%=VirtualPathUtility.ToAbsolute("~/Common/Scripts/UserControls/Form.js")%>></script>
You can try the following:
Find:
Replace:
The key things to note:
{}. I use[^"]+to capture all characters between the quotes – the[]matches a set of characters, where^means “not” – so[^"]matches anything except a quote. Then+means match one or more (non-quote characters).\. You can safely escape most chracters that don’t have meaning if you put an extra\unnecessarily in front of them, so I am overzealous just to be safe.\1,\2,\3, etc. to use captured groups in the replace expression. So I’m using\1to refer to thesrcattribute value matched in the find.