[TriLUG] simple regular expression to strip HTML?

Rodent of Unusual Size Ken.Coar at Golux.Com
Thu Feb 19 05:28:37 EST 2004


Jeremy Portzer wrote:
> 
> Does anyone know of a quick-and-dirty regular expression that will strip
> simple HTML tags?  I'm not looking for something that is necessarily
> 100% safe/tested, but something reasonable that will work.  It needs to
> use the regular C regexp set of calls, not Perl extensions.
> 
> For example:  "<em>Bold</em> type" should substitute to "Bold type"

perlish:  s:<[/a-z][^>]*>::gi;
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"Millennium hand and shrimp!"




More information about the TriLUG mailing list