in reply to Re: Regex split at number of occurrence
in thread Regex split at number of occurrence

Of course, that also works with a junky string:

c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -le "my $s = 'junk%%%first1:::sur1:::middle1%%junk%%first2:::sur2:::middle +2%%junk%%first3:::sur3:::middle3%%junk'; ;; my @arr = $s =~ /\w+:::\w+:::\w+/g; dd \@arr; " [ "first1:::sur1:::middle1", "first2:::sur2:::middle2", "first3:::sur3:::middle3", ]
but the OPer doesn't say if he or she is working with a validated string or not.


Give a man a fish:  <%-{-{-{-<