|
|
| Just another Perl shrine | |
| PerlMonks |
Re^3: Regex Extraction Helpby Kenosis (Deacon) |
| on Aug 09, 2012 at 19:05 UTC ( #986587=note: print w/ replies, xml ) | Need Help?? |
|
You make a good point about splitting on a record separator within possibly malformed records. Based upon the OP's regex, it appears that the pattern's stable--with one space after the semi-colon. However, we can ask split to 'test' the format of the input, like this:
This will return the info the OP wants, whether there are spaces before or after the semi-colon, or not. And within a regex on the OP's data:
It was a good call to address this issue...
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||