in reply to Re^2: Regex lookahead, lookbehind
in thread Regex lookahead, lookbehind

One last thing I need to extend to below match also

When asking for help on regexes, please provide all the possible test cases. Also, you can use a module like Test::More - first, write as many test cases as possible, then work on your regex until all the tests pass, or post the code here if you have trouble.

use warnings; use strict; use Test::More; my $regex = qr/foo/; like "foobar", $regex; unlike "quzbaz", $regex; # more test cases here done_testing;