# In php regular expression

Source: Internet
Author: User
# In php regular expressions recently, when studying the source code of discuz, I found that one of the regular expressions is roughly the preg_match ('# ^ [a-z] #', "");

At the beginning, I suddenly got lost. Is this a match first? So ^ doesn't it indicate what to start? This is not a conflict. so I went to the official website and checked the usage of preg_match. I found several examples:

If (preg_match ("/\ bweb \ B/I", "PHP is the web scripting language of choice. ") {echo" A match was found. ";} else {echo" A match was not found. ";}

The definition of pattern is wrapped in //. after testing, I found that # can be replaced by //. in this case, everything is understood, the more things we learn, the more things we don't actually know. the larger the things we know, the longer the unknown side around him.

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.