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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
<img([^>]*[^/])>
Description
Use this along with this replacement string &lt;img\1 /&gt; to convert image tags to XHTML compliant image tags.
Matches
<img src="bob">
Non-Matches
<img src="bob" />
Author Rating: The rating for this expression. Murray Roke
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: Does not account for src with http urls
Name: Baba
Date: 1/25/2006 4:53:12 PM
Comment:
This will not work with image urls of the type since they have '/' character in the src value. <img src="http://www.sampleweb.com/sample.gif"/> I am still learning regex. I think <img([^>]*(?(/>)))> will overcome that problem. Thanks, Baba


Title: Don't use regex to parse HTML
Name: Randal L. Schwartz
Date: 6/2/2005 2:25:44 PM
Comment:
Don't use regex to parse HTML.


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