perl -le '$d = "<moose>elk</moose>"; $p = qr/<.*?>/; $d =~ s/$p/" " x length $1/ge; print $d'
The is even simpler than what I suggested previously:
But once again, one of the HTML parsers may do a better job at this.
In reply to Re^5: Stripping HTML tags efficiently
by gaal
in thread Stripping HTML tags efficiently
by agynr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |