sub stripCtrls { my $text = shift; #changed capture of $1 as per moritz $text =~ /(<\/Mil[^>]*>)([^\x9D]*)\x9D/; my $sStartTag = $1; my $sBetweenTags = $2; $sBetweenTags =~ s/[\x90\x8F]//g; return "$sStartTag$sBetweenTags\x9D"; }
which you can call like this stripCtrls($sTaggedText).
And if you don't need to preserve \x90 and \x8F in the start tag, maybe you might try the even simpler $text =~ s/[\x90\x8F]//g?Best, beth
Update: put in sub so can be used as one liner
In reply to Re: Curious Regex
by ELISHEVA
in thread Curious Regex
by HamNRye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |