Is there a matching URL but a regular expression other than the picture?
For example, http://www.abc.com/and http://www.abc.com/images/index.php can all match,
But Http://www.abc.com/images/logo.gif can't match.
The expression I wrote will match to Http://www.abc.com/images/logo. This paragraph
(http\://)? ([a-z0-9_-]+\.) + (com|net|cn|org) {1} (\/[a-z0-9_-]+) *\.? (?! Jpg|jpeg|gif|png|bmp)
------Solution--------------------
Just did not test environment, feel free to write, think of a bit of a problem, find an environment to re-write a
$s = ' http://www.abc.com/image/index.php ' http://www.abc.com/images/logo.gif ';
Preg_match_all (' #/[^/]* (? <=\ .... (? ------Solution--------------------
GIF)) "#", $s, $m); -6
Var_export ($m);
In general, you can understand it and then change it.
Here \ .... Matches the dot and three-character extensions, without a dot extension or a three-character case.
------Solution--------------------
(? i) (?: HTTPS?)
------Solution--------------------
FTP)://[-a-z\d.] +/? (?! /) ([-a-z\d+&@#%=~_
------Solution--------------------
!:,.;] +/) * (? #去掉图片的URl) (?! [-a-z\d+&@#%=~_!,.;]. *?\. (?: JPG
------Solution--------------------
Jpeg
------Solution--------------------
Gif
------Solution--------------------
Png
------Solution--------------------
BMP)) [-a-z\d+&@#%=~_!,.;] *(?:\? [A-z\d+&@#/%=~_
------Solution--------------------
!:,.;] *)?