in reply to Re: Matching against list of patterns
in thread Matching against list of patterns
But be carefull if you want to get another matched text in this line. Somewhat it eats up all $1,$2,$3. Use $+ to get the last matched text of the line.my $pattern = join '|', map "($_)", @patterns; ... if ($line =~ /($pattern)/i) { print "matched $1\n"; }
Schuk
Edit: Sorry HV I should learn to read more carefully.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Matching against list of patterns
by hv (Prior) on Nov 18, 2004 at 13:07 UTC |