RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Strip HTML tags
Expression
<(\s*/?\s*)\w+?(\s*(([\w-]+="[^"]*?")|([\w-]+='[^']*?')|([\w-]+=[^'"<>\s]+)))*(\s*/?\s*)>
Description
This RE strips HTML open and close tags from text with any attributes provided, including not properly formatted tags.
Matches
<html>, <meta http-equiv=Content-Type content="text/html; charset=windows-1250">, < / html body="<'something'>" body='"any thing"' b=jj123-qqj / >
Non-Matches
<html / d>, <html body='something">, <d /html>
Author Rating: Not yet rated. István Dani
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials