in reply to Re^4: Regular Expression Doubtin thread Regular Expression Doubt
my $output = ""; while ($text =~ m{\G(?:+|(<maths>.*?<\/maths>|[^&<]+|.))}gs) { $output .= $1 || " + "; } print $output, "\n"; [download]