Perl Monk, Perl Meditation | |
PerlMonks |
Re: Iterator to parse multiline string with \\n terminatorby kcott (Archbishop) |
on Oct 06, 2013 at 06:34 UTC ( [id://1057125]=note: print w/replies, xml ) | Need Help?? |
G'day three18ti, In the absence of seeing a context requiring anything more complex, I'd probably code something along these lines:
Output:
That code could easily be adapted for an iterator if one is required for your application. If you're not familiar with negative look-behind assertions ((?<!pattern)), they're documented under Look-Around Assertions in "perlre: Extended Patterns". -- Ken
In Section
Seekers of Perl Wisdom
|
|