in reply to Identifying the position of match using regular expressions
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Identifying the position of match using regular expressions
by Anonymous Monk on Sep 15, 2012 at 06:21 UTC | |
by Athanasius (Archbishop) on Sep 15, 2012 at 06:43 UTC |