Please help me to see what is the problem with the regular expression of the intercepted URL? Thanks

Source: Internet
Author: User
Please help me to see what is the problem with the regular expression of the intercepted URL? Thank you for taking out the addresses of all images starting with http and writing this regular expression.
$ Regstr = 'http: //. * (\. jpg | \. png | \. gif )'
Use the function to match preg_match_all ($ regstr, $ strtest2, $ match). the address of the image can be retrieved smoothly from the strtest2 string, but cannot be retrieved from strings such as strtest1, please help me see where the problem is. thank you.

$ Strtest1 = '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 ;';

$ Strtest2 = '';


Reply to discussion (solution)

Use the following method.

 

Thanks for the Test availability.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.