in reply to Re^4: regex question - dynamically address captures
in thread regex question - dynamically address captures
orsub get_captures { my ($pattern, $line) = @_; my @captures = $line =~ m/$pattern/; shift(@captures) if !$#+; return @captures; }
sub get_captures { my ($pattern, $line) = @_; my @captures = $line =~ m/($pattern)/; shift(@captures); return @captures; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: regex question - dynamically address captures
by jkeenan1 (Deacon) on Jul 20, 2006 at 01:11 UTC |