in reply to Capturing substrings with complex delimiter, up to a maximum
Output:use strict; use warnings; use Data::Dumper; my $input = q|http://abc.org,http://de,f.org,https://ghi.org,http://jk +l.org|; my @urls = (split /,(?=http)/, $input, 4)[0..2]; print Dumper \@urls;
$VAR1 = [ 'http://abc.org', 'http://de,f.org', 'https://ghi.org' ];
|
|---|