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