Introduction to Regular Expressions _php tutorial

Source: Internet
Author: User
1. Regular expressions
If you have not used regular expressions, you may not be familiar with this term and concept. However, they are not as novel as you might think.
Remember how to find files on your hard disk. Are you sure you will use it? and * characters to help find the file you are looking for. Character matches the file name in the
A single character, while * matches one or more characters. One such as ' data? '. DAT ' mode can be found in the following files:
Data1.dat
Data2.dat
Datax.dat
DataN.dat
What if I use the * character instead? Characters, the number of files found will be enlarged. ' Data*.dat ' can match all of the following file names:
Data.dat
Data1.dat
Data2.dat
Data12.dat
Datax.dat
DataXYZ.dat
Although this method of searching for files is certainly useful, it is also very limited. and * The limited ability of wildcards can give you an overview of what regular expressions can do
But the regular expressions are more powerful and more flexible.


http://www.bkjia.com/PHPjc/445145.html www.bkjia.com true http://www.bkjia.com/PHPjc/445145.html techarticle 1. Regular expressions If you have not used regular expressions before, you may not be familiar with the term and concept. However, they are not as novel as you might think. Please recall ...

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