(PHP) The use of regular Expressions-preg_match and Preg_match_all ()

Source: Internet
Author: User
<?php/** * Regular Expression Exercise * user:ollydebug * DATE:2015/11/13 * time:13:28 *//* * Preg_match () The third parameter is optional, the third argument is a reference pass, which matches the subject , it will only match once * Preg_match_all () The third parameter is required, and the third parameter is a reference pass, which matches all the conditions of the subject when it matches the result */$pattern = '/[0-9]/'; $subject = ' Weuyr3ui76as83s0ck9 '; $m 1 = $m 2 = Array (), $t 1 = Preg_match ($pattern, $subject, $m 1); $t 2 = Preg_match_all ($pattern, $ Subject, $m 2); Show ($m 1); Echo '  

The above is the use of (PHP) regular Expressions-preg_match and Preg_match_all (), more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • 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.