Matching, ec2.images-amazon. match string
$handle="http://ec2.images-amazon.com/images/I/311%2Bk07cuIL._SL500_AA280_.jpg,http://ec2.images-amazon.com/images/I/418Qdk6bctL._SL500_AA280_.jpg,http://ec2.images-amazon.com/images/I/51bsLAswKVL._SL500_AA280_.jpg";
preg_match_all('#src="(http://ec2\.images-amazon\.com/images/I/[a-z\d]+\._SL500_AA280_\.jpg)"#is',$handle,$m);
print_r($m[1]);
I want to match http://ec2.images-amazon.com/images/ I /any region ._sl500_aa280_.jpg
Preg_match_all ('# src = "(http: // ec2 \. images-amazon \. com/images/I/[a-z \ d] + \. _ SL500_AA280 _\. jpg) "# is ', $ handle, $ m );
This section cannot match. what's the problem ??
Share:
------ Solution --------------------
The source code does not contain the src = "character. of course it cannot match. Write as follows:
preg_match_all('#http://ec2\.images-amazon\.com/images/I/.+?\._SL500_AA280_\.jpg#is',$handle,$m);
print_r($m);