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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Manage img
Expression
<img[\s]+[^>]*?((alt*?[\s]?=[\s\"\']+(.*?)[\"\']+.*?)|(src*?[\s]?=[\s\"\']+(.*?)[\"\']+.*?))((src*?[\s]?=[\s\"\']+(.*?)[\"\']+.*?>)|(alt*?[\s]?=[\s\"\']+(.*?)[\"\']+.*?>)|>)
Description
This pattern can intercept img like < img src="src1" alt="alt1"> or < img alt="alt1" src="src1"> or < img src="src1"> or < img src="src1" width=3 height=4> then values of src can be found in $5 or $8, the value of tag alt can be found in $3 or $10.
Matches
< img src="src 1" alt="alt 1"> or < img src="src 2"> or < img src="src 3" alt="alt 3" width=2 height=3>
Non-Matches
any other tag
Author Rating: The rating for this expression. Cordisco Massimo
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-2024, RegexAdvice.com | ASP.NET Tutorials