in reply to Re: Is there any way to get at paren matches from qr//
in thread Is there any way to get at paren matches from qr//
output:$line = "kernel: hda error 22"; $pat = "kernel: (.*?) error"; $re = /$pat/; if ( $line =~ $re ) { print "A: \$1 = $1\n"; if ( $line =~ /$pat/ ) { print "B: \$1 = $1\n"; } }
infinity(77)>./test.pl A: $1 = B: $1 = hda
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Is there any way to get at paren matches from qr//
by dave_the_m (Monsignor) on May 13, 2004 at 16:09 UTC | |
by nneul (Novice) on May 13, 2004 at 16:13 UTC | |
|
Re: Re: Re: Is there any way to get at paren matches from qr//
by nneul (Novice) on May 13, 2004 at 16:09 UTC |