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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find replace html tags with valid xhtml
Expression
(<input )(.*?)(>)
Description
Finds all &lt;input attrib1="value1" attrib2="value2" ... &gt; tags. You can make it end with "/&gt;" for xhtml compatibility replacing with the expression "&lt;input $2 /&gt;". You can repeat it with other tags like &lt;img /&gt; or &lt;br / &gt;
Matches
&lt;input attrib1="value1" attrib2="value2" &gt;
Non-Matches
any other tag
Author Rating: Not yet rated. Mauricio Venanzoni
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

Title: Broken - do not parse HTML with a simple regex
Name: Randal L. Schwartz
Date: 6/16/2006 4:02:29 PM
Comment:
This fails when an attribute contains a greater-than.


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