in reply to Moving sub-strings to the start of a line
my $p = 'This is an anchor <a name="_Toc00123998">and these are anothe +r<a name=_Toc00123999"><a name=_Toc00124000"> couple.'; $prefixes = ''; while ($p =~ s/(<a name=[^>]*>)//) { $prefixes .= $1; } $p = "$prefixes$p";
|
|---|