Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Use `\v` then `<` and `>`, and you can make it default.


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

    [[:<:]]foo[[:>:]]
...so it could be worse!


Use \b lol


That doesn't work in Vim. Or rather: it matches the backspace character, which isn't what you want.


Damn. My apologies, then.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: