in reply to Re: Need a regex to replace incomplete html entities
in thread Need a regex to replace incomplete html entities

Oops. Misread the output.

Nice!

And, for windows, change all the single quotes to doubles.

C:\>echo "one & two &# three &#3 four &#38 five & six" | perl -pe +"s/&(#(3(8(;\K)?)?)?)?//;" "one two &# three &#3 four &#38 five & six"