Displaying page
of
pages;
Items to
Title |
Test
Details
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
|
Title |
Test
Details
(X)HTML & char. replace
|
Expression |
&(?![a-z]+;|#\d+;)
|
Description |
Single & character is not valid in HTML or XHTML code. In this case you can replace this character with its entity (if & character is not member of other entity [&#353;]). example: preg_replace('/&(?!amp;)/', '&amp;', $str).
(thanks to mr. Mrva)
|
Matches |
&
|
Non-Matches |
&amp;|&quot;|&#353;|&blah;|&copy;
|
Author |
Rating:
Not yet rated.
Martin Švec
|
Displaying page
of
pages;
Items to