Gives$data =<<EOL; command = adb asd 2t525 command=adfaf adsgadg asd EOL @commands = split /(?=command)/,$data; foreach (@commands){ print "$_\n"; print "==========\n"; }
command = adb asd 2t525 ========== command=adfaf adsgadg asd ==========
In reply to Re: split but preserve the matching pattern
by artist
in thread split but preserve the matching pattern
by nwkcmk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |