patternmodifiers-modifier for regular Expressions (reprinted) find some regular _php tutorials in PHP

Source: Internet
Author: User
Pattern Modifiers-modifiers for regular expressions
The following are the decorations available in the current rule expression. The names in parentheses are the internal PCRE names of those modifiers.
I (pcre_caseless)
If this modifier is set, the expression is not case-sensitive.
M (pcre_multiline)
By default, PCRE that the target string value is a single-line string (even if he does contain more than one line). The line start tag (^) matches only the beginning of the string, and the end of line tag ($) matches only the tail of the string, or an end line (unless the E modifier is specified). This is the same as in Perl.
If this modifier is set, the line start and line end structures match the current position of any new line in the target string, or the previous one, and each start and end. This equals the/m modifier inside Perl. This modifier does not work if the target string does not have an "n" character, or if there is no ^ or $ in the pattern.
S (pcre_dotall)
If this modifier is set, a "point" in the pattern will match all characters, including line breaks. Without him, the line will be left out. This modifier is equivalent to the/s modifier inside Perl. An opposite type, such as [^a], will always match the newline character, regardless of the modifier's limit.
X (pcre_extended)
If this modifier is set, the number of spaces in the pattern will be ignored, unless the escape character, or the inner type of a character, and the non-escaped # number outside all character types are ignored. This is equivalent to the/x modifier in Perl, which adds a comment to the complex pattern. Note that this applies only to data characters. The space character will not appear in the specified order of pattern characters.
E
If this modifier is set, Preg_replace () will perform a normal replacement in the replacement value, etc.

http://www.bkjia.com/PHPjc/445250.html www.bkjia.com true http://www.bkjia.com/PHPjc/445250.html techarticle Pattern Modifiers-modifier for regular expressions The following are the modifiers available in the current rule expression. The names inside the parentheses are the internal PCRE names of those modifiers. I (pcre_caseless) if set ...

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