in reply to Need a regex to replace incomplete html entities

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

hehehe

Replies are listed 'Best First'.
Re^2: Need a regex to replace incomplete html entities
by ww (Archbishop) on Nov 20, 2016 at 16:01 UTC
    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"