regex - In Vim, is there a "matching braces/parenthesis/etc" equivalent in substitute/search symbols? -


i replace instance every occurrence of "foo{...}" except newlines inside bracket (there may spaces, other brackets opened , closed, etc) not followed "bar".

for instance, "foo{{ }}" in "foo{{ }}, bar" match not "foo{hello{}}bar".

i've tried /foo{.*}\(bar\)\@! , /foo{.\{-}}\(bar\)\@! first 1 match "foo{}bar{}" , second match "foo{{}}bar" (only "foo{{}" part).

this regex:

foo{.*}\([}]*bar\)\@! 

matches:

foo{{ }} foo{{ }}, bar 

but not:

foo{hello{}}bar 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -