in reply to Split with data keep
my (@articles) = ($text =~ /(<a name.*?<!--start-->.*?<!--end-->)/gs);
Of course this is doing two stingy matches in one pattern which is probably godawful slow.
Update: Or use a hash instead
my (%hash) = ($text =~ /(<a name.*?)(<!--start-->.*?<!--end-->)/gs);
|
|---|