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
Post a Comment