Hello,
I am using « negative lookbehind » pattern matching, and I get a very strange result.
Here is the simple code:
use strict; use warnings; my $s = '"toto"'; if ($s =~ /^(?<!\\)"(((?<=\\)"|[^"])+)(?<!\\)"$/) { print "It matches!\n"; print $1 . "\n"; print $2 . "\n"; }
And this is the result:
It matches! toto o
????
Where does the « o » come from ?
Any idea ?
Best regards
Denis
In reply to negative lookbehind and VERY strange capture by Denis.Beurive
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |