s{^\s*[-?](.*)$}{}mg; # note the m rather than s modifier s/([^>])$/$1
/mg; # add
only where no closing tag at EOL s{\n