Regex to Remove HTML Tags
Home
Search Website:

Certifications


Cisco


IP


PC


Protocols


Routers


SQL


Security


Telecommunications


Tools


Unix


Web







Regex to remove HTML Tags

A friend of mine asked for a regex to remove all HTML tags from a webpage and to leave everything else, including what's between the tags and this is the regular expresion that I came up with for him:

s/<[a-zA-Z\/][^>]*>//g
or
s/<(.*?)>//g

Another option is to strip out only certain tags and that can be done as:

</?(?i:script|embed|object|frameset|frame|iframe|meta|link|style)(.|\n)*?>



This page was created in 0.00083 seconds
Comments and Questions
Last modified: January 14 2012.