Perl: the Markov chain saw | |
PerlMonks |
Re^3: regex'ing source codeby muba (Priest) |
on Jun 29, 2012 at 03:47 UTC ( [id://979039]=note: print w/replies, xml ) | Need Help?? |
Well, even if split didn't had that handy bit of also returning the things it captured, you could've gone my @parts = $line =~ m/(\t|[^\t])/g;, which does essentially the same. With that regex you tell perl, "gimme an array of all tabs and all sequences of non-tabs."
In Section
Seekers of Perl Wisdom
|
|