in reply to Re^5: Match a pattern only if it is not within another pattern
in thread Match a pattern only if it is not within another pattern
Well, technically the OP does say "surrounded", ...Actually not.
to me it's conceivable that it also meant the reverse of bar.+qux, although it is a stretch. I agree that the examples do not indicate this, however.# replace all foo(s) above with 123 except for the ones that are # surrounded by bar and qux
bar foo qux qux foo bar qux foo bar bar foo qux
although the first one could be seen as overlapping nesting and then we get into a whole 'nother realm of questions =) In any case, I agree that, except in extreme cases, your original response would be more than sufficient. I am merely trying to present another possible interpretation.bar qux foo bar qux bar foo qux foo bar foo qux
|
|---|