[thelist] Strip HTML Tags Regular Expression

Hershel Robinson hershelr at netvision.net.il
Wed Jul 3 12:14:07 CDT 2002


> Can someone please provide me with the Javascript regular
> expression that will strip out all HTML tags from a page.

I don't know how much JavaScript supports regexes, but here is a simple pair
which do *most* of the work.  I'm sure a regex pro could do better, but I'm
not one!

s/<.*?>/ /g
s/&nbsp;/ /g

HTH,
Hershel




More information about the thelist mailing list