If you ever wonder what something matched, you can use
my $at = $-[0]; my $matched = substr($test, $at, $+[0]-$at); warn(Matched "$matched" at $at\n");
Alternatively, you could pass the argument -Meval=debug to perl. (e.g. perl -Mre=debug script.pl). It produces a detailed (i.e. long) report of all regexp activities.
References:
In reply to Re^3: Angle brackets and regex problem
by ikegami
in thread Angle brackets and regex problem
by emav
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |