in reply to Re^2: Making regex /g match continuously
in thread Making regex /g match continuously
# Option 1: my $item_regex = qr/ (?:int)\s+(\w+)\s*?\n (?:\s*Number\ of\ Flaps:\s(\d+)\s*?\n)? (?:\s*IP\sAddress:?\s([\d\.]+)\s*?\n)? /x; while (<DATA>) { if (/^$item_regex+\Z/) { print "$1, $2, $3\n" while (/\G$item_regex/g); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Making regex /g match continuously
by scottb (Scribe) on Jan 07, 2005 at 20:23 UTC | |
by Roy Johnson (Monsignor) on Jan 07, 2005 at 20:39 UTC | |
by tye (Sage) on Jan 08, 2005 at 07:59 UTC | |
by Roy Johnson (Monsignor) on Jan 10, 2005 at 18:37 UTC | |
by scottb (Scribe) on Jan 07, 2005 at 22:02 UTC | |
by Eimi Metamorphoumai (Deacon) on Jan 07, 2005 at 20:37 UTC |