go ahead... be a heretic | |
PerlMonks |
Re: Split without removing charactersby cmeyer (Pilgrim) |
on Jun 17, 2005 at 19:54 UTC ( [id://467865]=note: print w/replies, xml ) | Need Help?? |
Try using the zero-width look-behind and look-ahead matches: @stuff = split /(?<=[a-z])(?=[A-Z])/;This means that the regex matches at a point where there is a lowercase letter immediately preceding, and an uppercase letter immediately following, but neither of these letters are consumed by the match. More info: perlre -Colin. WHITEPAGES.COM | INC
In Section
Seekers of Perl Wisdom
|
|