Regular Expressions-ask PHP for regular matches when a slash or colon causes problems

Source: Internet
Author: User
Keywords PHP Regular Expressions
PHP Regular Expressions

Preg_match_all ("/>[\w+=\". *\ "\s]+

I use the regular to match a string similar to the following:

src1= "111" src2= "BB" src3= "CCC"

The matching result is: >src1= "111" src2= "BB" src3= "CCC" <, so that the correct results can be obtained.

But there is a problem with the URL in my target string, as follows:

src1= "http://baidu.com/" src2= "BB" src3= "CCC"

This does not match anything after running.

My regular expression is written like this \w+=\ ". *\" \ is used to match src1= "http://baidu.com/" this paragraph. That is. * represents all content, but when there is a/or colon in the quotation mark does not come out, ask God to guide ha, thank you

  • Related Article

    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.