in reply to Matching pattern in regular expression with string position
Within the if statement,
my $pos = pos( $variable ) - 1;
should do the trick.
See perlfunc:pos for more information.
You might also look at perlvar:$+ * pervar:$-, but these are only set when captiring brackets are used.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Matching pattern in regular expression with string position
by diotalevi (Canon) on Aug 09, 2003 at 13:24 UTC | |
|
Re: Re: Matching pattern in regular expression with string position
by sauoq (Abbot) on Aug 09, 2003 at 19:18 UTC |