PHP Regular expression can not understand, please instruct

Source: Internet
Author: User
PHP Regular expression can not understand, please point
Identify the identifier [a-za-z_][a-za-z_0-9]*] from the program code certificate.

How do I write in the code? I don't know how to write this code? Please give a small example to see.

Share to: more


------Solution--------------------

[A-za-z_] [a-za-z_0-9]*

Uppercase A-Z or lowercase a-Z or underscore plus any number of uppercase A-Z or lowercase a-Z or underscore
Just look at the code of the night regular, practice more.


------Solution--------------------
Preg_match_match ('/^[a-za-z_][a-za-z_0-9]*.$/', $str, $ret);
Print_r ($ret);
------Solution--------------------
Hand Error
Preg_match_all ('/^[a-za-z_][a-za-z_0-9]*.$/', $str, $ret);
Print_r ($ret);
------Solution--------------------
Reference:
Quote: Reference:

Preg_match_match ('/^[a-za-z_][a-za-z_0-9]*.$/', $str, $ret);
Print_r ($ret);


Please advise,
("/^[a-za-z]\d{9}$/", $str) This sentence please explain to me, two A/slash what meaning? ^ What do you mean here? What do you mean, x.$/?

Are the regular basis Ah, Baidu down bar.
  • 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.