You can use the index function. For example:
>perl -Mstrict -we "my $s = q[ABCDFEFFAA]; print index($s, $1), qq[\n] + if $s =~ /(AA)/;" 8
Hope that helps,
Athanasius <°(((>< contra mundum
In reply to Re: Identifying the position of match using regular expressions
by Athanasius
in thread Identifying the position of match using regular expressions
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |