It's OK to put it in the online test kit, but it doesn't work with the echo array in the file.

Source: Internet
Author: User
It's OK to put it in the online test tool, but it doesn't work with the echo array in the file.
This is the regular test tool that I can correctly match, why put to Preg_match_all ('/(\@[a-z]+\|[ \u4e00-\u9fa5]+\| [a-z]+\| [a-z]+\| [a-z]+\| [0-9]+)/is ', $a) is not good? Test tool Inside I choose the global search is OK, not select is not, is this the reason? Preg_match_all not a global search?
Regular

Share to:


------Solution--------------------
The correct wording is:
/(\@[a-z]+\
------Solution--------------------
[\x{4e00}-\x{9fa5}]+\
------Solution--------------------
[A-z]+\
------Solution--------------------
[A-z]+\
------Solution--------------------
[A-z]+\
------Solution--------------------
[0-9]+]/isu
------Solution--------------------
This \u4e00-\u9fa5 is a Unicode-encoded Chinese section, so you can see that your test tool is in the form of a Web page.
The regular engine of PHP does not recognize this format, and naturally it will not get the correct results.
------Solution--------------------
reference:
Quote: reference:
The correct wording is:
/(\@[a-z]+\
------Solution--------------------
[\x{4e00}-\x{9fa5}]+\
------ Solution--------------------
[a-z]+\
------Solution--------------------
[a-z]+\
------Solution-------- ------------
[a-z]+\
------Solution--------------------
[0-9]+]/isu
br>, thank you for the results. Already, ask, why I before those online test tools inside test The following this rule, can get the correct match, put in the file is not possible?
@[a-z]+\
------Solution--------------------
[\u4e00-\u9fa5]+\
------Solution--------------------
[A-z] +\
------Solution--------------------
[a-z]+\
------Solution--------------------
[a-z]+\
------Solution- -------------------
  • 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.