if ($part2 =~ (/A[BGIP]001/)|(/T[ER]001/)|(/CP002/)|(/MF00[12]/)|
(/OS001/)|(/T[ER]001/)|(/SY001/)) {
I'm using the regex above to find out if any of the listed message codes are in the current input line. What I need to know, is: If there is a match, is there any way to extract whatever matched and put it into a variable? I know that I could put in an if then else set of structures for every message type, but that's too cumbersome. I'd appreciate any ideas.
PETERV
PETERV
Syracuse, NY &
Boston, MA
(/OS001/)|(/T[ER]001/)|(/SY001/)) {
I'm using the regex above to find out if any of the listed message codes are in the current input line. What I need to know, is: If there is a match, is there any way to extract whatever matched and put it into a variable? I know that I could put in an if then else set of structures for every message type, but that's too cumbersome. I'd appreciate any ideas.
PETERV
PETERV
Syracuse, NY &
Boston, MA