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
In reply to Re: How to regex this one out?
by perlsen
in thread How to regex this one out?
by MelaOS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |