Title |
Test
Find
IMG tag
|
Expression |
<img[^>]*src=\"?([^\"]*)\"?([^>]*alt=\"?([^\"]*)\"?)?[^>]*> |
Description |
Use this RegExp to grab SRC($1) and ALT($3) values from IMG tags in valid or invalid HTML (XHTML). SRC param must by before IMG. (thanks to mr. Mrva) |
Matches |
<img src="xxx"> | <img src=xxx> | <img src="xxx" alt="xxx" /> | <img src="xxx" alt="xxx" width="N" height="N" /> | etc. |
Non-Matches |
<img> | <img /> | <img alt="XXX" src="XXX"> |
Author |
Rating:
Martin Švec
|
Source |
|
Your Rating |
|
Title: Update
Name: Anon
Date: 6/1/2007 12:36:28 AM
Comment:
Needed update for a apostophe (I know a rarity):
<img[^>]*src=\"?\'?([^\"][^\']*)\'?\"?([^>]*alt=\"?([^\"]*)\"?)?[^>]*>