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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Tag InnerHTML Remover
Expression
(<(tag1|tag2)[^>]*\/?>)[\w\S\s]*?(<\/(?:\2)>)
Description
This will remove the InnerHTML of a tag. For instance, if you wanted to clear all paragraphs and h1 tags on a page, you would simply put in "p" and "h1" into those tags, and they would end up looking like <h1></h1> <p></p> <p></p>. It's useful when you're doing work based off a template and you need to get back to the original template.
Matches
<tag1>Lorem ipsum dolor sit amet</tag1>
Non-Matches
<tag1>Lorem ipsum doler</othertag>
Author Rating: Not yet rated. Kerry Jones
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