3 ms·
If you replace div> then you will miss any opening tags that have attributes. E.g. <div class=baz> or <div id=foobar>. In Vim I would do :%s@\(</\?\)div@\
by codetrotter 7y ago
If you replace div> then you will miss any opening tags that have attributes. E.g. <div class=baz> or <div id=foobar>.
In Vim I would do
:%s@\(</\?\)div@\1p@g
It’s a little bit convoluted but it replaces the tag names in both opening and closing tags and does not replace it anywhere else.
- frereubu 7y agoFair point...