in reply to how to make // not return what is in a parenthesis?
One way would be:
>perl -wMstrict -le "my $s = 'ABC1D A2D D3A foo4bar'; my @matches = $s =~ m{ A (?: BC)? (\d+) D }xmsg; print qq{'$_'} for @matches; " '1' '2'
Updates:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to make // not return what is in a parenthesis?
by beanryu (Novice) on Aug 01, 2010 at 02:04 UTC |