by kleiba · 7y ago · 0 comments
How would you avoid "inpiduals" (and similar mistakes) in other editors?
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.Since the “word” in question is “<div>”, I thought the \< was just an escape. I looked in various docs and the best I see in Tcl re_syntax(n) is \< and \> are synonyms for [[:<:]] and [[:>:]] respectively, which are constraints matching empty strings at the beginning and end of words, where a word a sequence of word characters... [a-zA-Z0-9_]
TIL, too...