kcitren has asked for the wisdom of the Perl Monks concerning the following question:
I've got a file that I'm parsing through with:
while (<file>)
the format of the file is this:
blahal askdjf, asdf jdfasd"asdf"(REGEX1)
kkdjf "REGEX2", (REGEX1), (REGEX3) "teets"
I'm trying to run a function any time certain regex's appear.
if (/(regex1|regex2|regex3)/gi) { f($1); }
but this only seems to grab once per line even if multiple regex's appear on a line.
How do I get this to run for each regex found?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple regex catches on a line
by stephen (Priest) on Jun 20, 2001 at 04:06 UTC | |
|
Re: Multiple regex catches on a line
by lemming (Priest) on Jun 20, 2001 at 04:06 UTC | |
|
Re: Multiple regex catches on a line
by dimmesdale (Friar) on Jun 20, 2001 at 19:31 UTC |