in reply to How to regex this one out?
while(<DATA>) { =head if ($_=~ m#^(\d+)\s+(\w{3}).*?\<\s+((.*?)(mV|db)).*?#gsi) { print "$2 \t $3\n"; } =cut if ($_=~ m#^(\d+)\s+(\w{3})(.{24}).*?(\d+\.\d+\s+\w+).*?#gsi) { #print "$&\n"; print "$2 \t $4\n"; } } #output #abc 450.98 mV #bcd 50.70 dB #are 50.00 dB __DATA__ 605 abc xxx 410.00 mV < 450.98 mV < 490.00 mV 606 bcd yyy -46.50 dB < 50.70 dB 607 are zzz 50.00 dB < 58.48 dB
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to regex this one out?
by albert (Monk) on Jun 15, 2006 at 10:08 UTC |