in reply to How can I split a string into chunks of 4 characters
Use a positive look-ahead assertion, like so:
2:28 >perl -MData::Dump -we "my $s = '01234abc'; my @a = $s =~ /(?=(. +{4}))/g; dd @a;" ("0123", 1234, "234a", "34ab", "4abc") 2:29 >
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|