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)
In reply to Re: Can anyone make this regex job neater?
by jeffa
in thread Can anyone make this regex job neater?
by Melly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |