On the basis of some html editing I've came up with need for help from some VIM master out there.
I wan't to achieve simple task - I have html file with mangled urls.
<a href="http://some/wrong/url with variable number of spaces">Just description</a> <a href="http://some/wrong/url with three spaces">Just description</a>
...
<a href="http://anoter/wrong/url with completely other number of spaces">Just description</a>
Unfortunately it's not "one url per line".
I am aware of three approaches:
I would like to be able to replace only within
'"http://[^"]*"'
regex (similar like replace only in matching lines - but this time not whole lines but only matching pattern should be involved)Or use sed-like labels - I can do this task with sed -e :a -e
's#\("http://[^" ]*\) \([^"]*"\)#\1_\2#g;ta'
Also I know that there is something like
"\@<="
but I am non native speaker and vim manual on this is beyond my comprehension.
All help is greatly appreciated.
If possible I would like to know answer on all three problems (as those are pretty interesting and would be helpful in other tasks) but either of those will do.