I’m looking for a way to replace all dots in a line except the last one.
Example:
Blah - whatever - foo.bar.baz.avi should become
Blah - whatever - foo bar bar.avi
Since I’ll have more than one line in the file and the amount of dots varies in each line I’m looking for a generic solution and not something like “Replace the first X matches” with X being a constant.
This seems to do the trick:
\@=is a lookahead. It only matches a full stop if there are any following full stops.See
:help zero-width.