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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Get Plain Text From Html (Remove Html Tags)
Expression
<[^>]*>
Description
This Regex Will Remove All Html Tags And Return Simple Plain Text . For Example In C#.NET : Regex.Replace(Html, "<[^>]*>", string.Empty);
Matches
<p> Hello Ali Delshad </p>
Non-Matches
Hello Ali Delshad
Author Rating: The rating for this expression. Ali Delshad
Source http://faradade.com
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

Title: What if style, comment, script tags?
Name: Ho Khac Huy
Date: 7/30/2010 5:06:43 AM
Comment:
What we get within style, comment, script tags?


Title: Doesn't work in all cases
Name: Speednet
Date: 10/13/2008 10:51:30 AM
Comment:
You are not accounting for cases when an angle bracket is enclosed in a quoted attribute. For example: <div title="Look here ->"> That example is perfectly valid markup, and using your expression you would match <div title="Look here ->. The pattern needs to be: <(?:"[^"]*"|'[^']*'|[^"'>])*> That will account for quoted attributes using either full quotes or single quoutes.


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