in reply to Can anyone make this regex job neater?
I would first split each line on the pipe character and do something with the resulting array.
I try to avoid using $1, $2, etc. directly.my @line = split('\|', $_); if ($line[0] eq 'NTE') { # parse NTE line } elsif ($line[0] eq 'OBX') { # parse OBX line } else { # got something unexpected }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can anyone make this regex job neater?
by Tanktalus (Canon) on Oct 11, 2005 at 16:48 UTC |