The Regular of PHP

Source: Internet
Author: User
Tags printable characters

1<?PHP2 /*3 non-printable characters4 \c----{4E00--9FA5} \x----{a-za-z}5 \f----Match a page break6 \ n----match a line break7 \ r----Match a carriage return line8 \s----matches any whitespace character, including spaces, tabs, page breaks9 \s----matches any non-whitespace character \s complementTen \ t----match a tab One \v----Match a vertical tab A  - Special Characters - $-----Matches the end position of the input string the ^-----Match the start of the input string - ()----marks the start and end positions of a subexpression - *-----match the preceding subexpression 0 or more times - +-----Match the preceding subexpression one or more times + .-----match any single character except a newline character - \-----To mark the next character or special character, or literal character, or backward reference, or octal escape character + {-----The start of a tag qualifier expression A |-----indicate a choice between the two items at      - Qualifier - * matches the preceding subexpression 0 or more times. For example, zo* can match "z" and "Zoo". * Equivalent to {0,}.  - + matches the preceding subexpression one or more times. For example, ' zo+ ' can match "Zo" and "Zoo", but not "Z". + equivalent to {1,}.  -     ? Matches the preceding subexpression 0 or one time. For example, "Do (es)?" can match "do" in "do" or "does".? Equivalent to {0,1}.  - {n} n is a non-negative integer. Matches the determined n times. For example, ' o{2} ' cannot match ' o ' in ' Bob ', but can match two o in ' food '.  in {n,} n is a non-negative integer. Match at least n times. For example, ' o{2,} ' cannot match ' o ' in ' Bob ', but can match all o in ' Foooood '. ' O{1,} ' is equivalent to ' o+ '. ' O{0,} ' is equivalent to ' o* '.  - {n,m} m and n are non-negative integers, where n <= m. Matches at least n times and matches up to M times. For example, "o{1,3}" will match the first three o in "Fooooood". ' o{0,1} ' is equivalent to ' O? '.    Note that there can be no spaces between a comma and two numbers. 

The Regular of PHP

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.