html - How to replace "-" with "_" in Vim using regular expressions? -
Do you want me to replace For example: Previously: : It should be repeated until it matches: - 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).
& 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;
% s / \ (\ (src \ | src \) * = * "[^" -] * \) - / \ 1_ / g
Comments
Post a Comment