|
|||||
|
|
|||||
![]() Certifications ![]() Cisco ![]() IP ![]() PC ![]() Protocols ![]() Routers ![]() SQL ![]() Security ![]() Telecommunications ![]() Tools ![]() Unix ![]() Web |
Regex to remove HTML TagsA 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\/][^>]*>//gor 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.00105 seconds
Comments and Questions
Last modified: January 14 2012. |
||||