html - How to replace "-" with "_" in Vim using regular expressions? -


Do you want me to replace - to _ with a regexp I can give advice on my HTML file but focus on href and src attributes (no changes are made to my webpage's content only).

For example:

Previously:

  & lt; A href = "my-profile.html" & gt; PLF series & lt; / A & gt; & Lt; Img src = "images / my-sample.jpg" & gt; After   

:

  & lt; A href = "my_profile.html" & gt; PLF series & lt; / A & gt; & Lt; Img src = "picture / my_sample.jpg" & gt;    

It should be repeated until it matches:

 % s / \ (\ (src \ | src \) * = * "[^" -] * \) - / \ 1_ / g    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -