use English; @a = qw/abbabbbababba ababbabbba abbbabbaba/; foreach (@a) { print "$PREMATCH $MATCH $POSTMATCH\n" if /(?<!b)b(?!b)/ } abbabbba b abba a b abbabbba abbbabba b a
i.e: Only match a b if there is no b before or after it. Although this doesn't really have to do with what you were talking about in the root node, it is one of the easiest ways of doing it.
In reply to Re: Re: left-non-greedy regex?
by Paladin
in thread left-non-greedy regex?
by dash2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |