Would you please help me to see the regular problem of this interception URL? Thank
This post was last edited by Liao3bafa on 2014-10-10 13:34:29
I need to take out the address of all the images that start with HTTP and write the regular
$regstr = ' http://.* (\.jpg|\.png|\.gif) '
Use the function to match Preg_match_all ($regstr, $strtest 2, $match), Strtest2 This string can be successfully taken out of the image of the address, but for strtest1 such a string but can not be removed, please help me to see where the problem is, Thank
$strtest 1 = ' e7342287f1485896249c474049d5317c:1:0:|http://img01.taobaocdn.com/bao/uploaded/i1/t1dnrmfejaxxxxxxxx _!! 0-item_pic.jpg;78e4591d5b18775a71912801623c0d26:1:1:|http://img01.taobaocdn.com/bao/uploaded/i1/1643666761/ tb2amrfafxxxxbgxpxxxxxxxxxx_!! 1643666761.jpg; ';
$strtest 2 = ";
------to solve the idea----------------------
Use the following.
$strtest 1 = ' e7342287f1485896249c474049d5317c:1:0:
------to solve the idea----------------------
Http://img01.taobaocdn.com/bao/uploaded/i1/T1dNrmFEJaXXXXXXXX_!!0-item_pic.jpg;78e4591d5b18775a71912801623c0d26:1:1:
------to solve the idea----------------------
http://img01.taobaocdn.com/bao/uploaded/i1/1643666761/TB2aMrfaFXXXXbGXpXXXXXXXXXX_!!1643666761.jpg; ';
$strtest 2 = '------To solve the idea----------------------
Rel= "tag" >------Solutions----------------------
Http://img01.taobaocdn.com/bao/uploaded/i1/T1dNrmFEJaXXXXXXXX_!!0-item_pic.jpg "alt=" research and Development "class=" thumb "/>";
$regstr = '/http:\/\/img.* (?: \. Jpg
------to solve the idea----------------------
\.png
------to solve the idea----------------------
\.gif)/U ';
Preg_match_all ($regstr, $strtest 1, $match);
Var_dump ($match);
Preg_match_all ($regstr, $strtest 2, $match);
Var_dump ($match);
?>