othree / eregex.vim

Perl/Ruby style regexp notation for Vim
http://www.vim.org/scripts/script.php?script_id=3282
214 stars 18 forks source link

Implement \b conversion #28

Open sheerun opened 4 years ago

sheerun commented 4 years ago

It seems to me that \(\(\_^\|\_$\|\W\)\)\@= should work as replacement, no?

sheerun commented 4 years ago

Sorry, \(\(\(\_^\|\_$\|\W\)\)\@<=\|\(\(\_^\|\_$\|\W\)\)\@=\), but \(\<\|\>\) also works

Maswor commented 2 years ago

I also found missing \b making target specific keyword (like new MyClass() instead of myNewVariable extremely limiting. Hope it get resolved!

sunaku commented 2 years ago

\(\<\|\>\) also works :heavy_check_mark:

@sheerun could you please submit a PR for this? I'm currently using it as follows:

let vim_regex = E2v(the_users_extended_regex_goes_here)
let vim_regex = substitute(vim_regex, '\\b', '\\(\\<\\|\\>\\)', 'g')

Thanks.

Silentdoer commented 1 year ago

\B is unattainable, is it?