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
In reply to Re: Re: Is there any way to get at paren matches from qr//
by nneul
in thread Is there any way to get at paren matches from qr//
by nneul
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |