I want to match "bar test" not preceded by "foo" and also account for multiple whitespace characters.
my $regex = "(?<!foo)\\s+bar\\s+test"; my $txt = "foo bar \ntest"; if($txt =~ /($regex)/i) { print "match"; } else { print "not a match"; }
I would expect it to not match but it does. What is wrong with the regex?
In reply to look behind with multiple whitespace characters by RK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |