Don't ask to ask, just ask | |
PerlMonks |
Re: Regex and splittingby Kenosis (Priest) |
on Apr 29, 2012 at 16:17 UTC ( [id://967947]=note: print w/replies, xml ) | Need Help?? |
Here's another regex w/split:
Actually, by studying split, your are also studying regexes, since split takes a regex. There are excellent solutions above, including AnomalousMonk's showing how to leverage modules, so you don't need to reinvent the (regex) wheel. Perl's "There's more than one way to do it" (TMTOWTDI) dictum is clearly evidenced by the many responses to your query, and it can be justifiably asserted about these that--as Adrian Monk says--"It's a blessing, and a curse."
In Section
Seekers of Perl Wisdom
|
|