That incorrectly matches "foobbarfoo".m{ foo ( # save to $1 [^b]* # 0 or more non-b characters (?: b+ # 1 or more b's (?: a(?!r) # an 'a' NOT followed by an 'r' | # or [^a] # a non-a character ) [^b]* # 0 or more non-b characters )* # that whole b... subset, 0 or more times ) foo # and foo }x;
Again, optimization is the root of all evil. :-)
In reply to RE (tilly) 4 (good try): Regex'ing backreferences
by tilly
in thread Regex'ing backreferences
by Uruk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |