← Back to context

Comment by AlexErrant

1 year ago

I die inside whenever I use `\<` and `\>` for word boundary regex. Neovim has no plans to change this either. I'll likely switch eventually so I don't have to know two flavors of regex. One is hard enough.

Only two?! *cry in posix BRE, posix ERE, PCRE, JS regexp, .NET regexp, emacs regexp*

  • ...you just made me realize I know (some of) the differences between JS and .NET regexp, in addition to vim and PCRE.

    Profanity.

I just add `\v` (very magic) to make it interpret regex more strictly. I’ve just tested it and you don’t need to escape these anymore to match word boundaries.

I gather that in really old regex syntax the word boundary syntax used to be like this:

    [[:<:]]foo[[:>:]]

...so it could be worse!