in reply to Re: Calculating variable {n} in regex match
in thread Calculating variable {n} in regex match
FWIW:
>perl -wMstrict -le "my $s = '123 234 3456789 3210 34567'; ;; my @m = $s =~ m{ \b ((\d) (??{ qr{\d{$^N}} })) \b }xmsg; print qq{@m}; ;; my $i = 2; @m = $s =~ m{ \b (??{ ++$i; qr{\d{$i}}; }) \b }xmsg; print qq{@m}; " 234 2 3210 3 123 3456789
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Calculating variable {n} in regex match
by atreyu (Sexton) on Jun 14, 2012 at 14:02 UTC | |
by AnomalousMonk (Archbishop) on Jun 14, 2012 at 17:15 UTC |