The above regular expression matching problem solved-php Tutorial

Source: Internet
Author: User
The above regular expression matching solves the problem and finds the cause, but the original post cannot be replied or modified.

To sum up:
To match all image addresses in a webpage address, write the regular expression as follows:
$reg="/\"\']*)/i";

Why is the image file address as follows:


Only matching:
  


The reason is the browser... Chrome I use
$reg="/\"\']*)/i";$s = '';preg_match_all($reg, $s, $m);print_r($m);


Output after running:
Array(    [0] => Array        (            [0] => 


Chrome
 Array        (            [0] => ../Images/Album Cover/album_012.jpg        ))

All deleted! It is in the source code, that is, the source code of the final page cannot see this paragraph! In firefox, the above section is not directly visible on the webpage. you can find this section by looking at the source code, and it is marked in red. is this decisive force me to change firefox?


Reply to discussion (solution)

....
Echo'

';
Print_r ($ m );

....
Echo'

';
Print_r ($ m );
Added
Is to output the above result, it should be chrome's security protection measures, delete the bad code in the result, do not believe you can try another chrome, my chrome version is 29.0.1541.0

Changed firefox.

I tried it. it seems like this is the case. Use firefox.

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.