in reply to Regular Expression Doubt

My favourite idiom to tackle this kind of problems, is "replace stuff that shouldn't change, by itself", that's an easy way to simply skip past it. It is, in general, like this:
s/($NOCHANGE)|$TOCHANGE/defined $1 ? $1 : $REPLACE /ge;

If matching values for $1 cannot ever be false, this can also be written as

s/($NOCHANGE)|$TOCHANGE/$1 || $REPLACE /ge;

For your particular example, this becomes:

$text =~ s<(<maths>.*?</maths>)|&plus;>{ $1 || '&thinsp;&plus;&thinsp; +' }ge;
</code>