in reply to Re^2: Calculating variable {n} in regex match
in thread Calculating variable {n} in regex match
very clever...thanks.# the original number of integers to test (will be one-upped) my $i = 1; # the input string to be tested (a number) my $foo = shift; # see if the input string is a two-digit number my $rc = ($foo =~ m{ \b (??{ ++$i; qr{\d{$i}}; }) \b }xmsg) ?'Y' :'N';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Calculating variable {n} in regex match
by AnomalousMonk (Archbishop) on Jun 14, 2012 at 17:15 UTC |