What are PHP regular expressions such as I, is, s, and isU? I match the dot metacharacters (.) In case-insensitive s mode (.) match All characters, including the blank characters in the line break x mode, which are ignored except escaped or in the character class, all the characters between # And the next line break except the unescaped character class, including
What are PHP Regular Expressions/I,/is,/s,/isU and so on? I match the dot metacharacters (.) In case-insensitive s mode (.) match All characters, including the blank characters in the line break x mode, which are ignored except escaped or in the character class, all the characters between # And the next line break except the unescaped character class, including
What are PHP Regular Expressions/I,/is,/s,/isU and so on?
I matching case
In s mode, the dot metacharacter (.) matches all characters, including line breaks.
In x mode, white space characters are ignored except escaped characters or in character classes. In addition to the unescaped character classes # And all characters between the next line break, including two headers, are ignored.
If this modifier is set for A (PCRE_ANCHORED), the mode is forced to "anchored", that is, to force matching only from the beginning of the target string, that is, it is automatically added to the beginning of the Mode ^.
D (PCRE_DOLLAR_ENDONLY) If this modifier is set, the dollar character in the pattern matches only the end of the target string. Without this option, if the last character is a line break, the dollar sign will also match before this character (but not before any other line breaks ). If the m modifier is set, ignore this option. Perl does not have an equivalent modifier. S when a mode is used several times, it is worth analyzing for acceleration matching. If this modifier is set, additional analysis is performed. Currently, the analysis mode is only useful for non-anchored modes without a single fixed start character.
U (PCRE_UNGREEDY) This modifier reverses the value of the matching quantity so that it is not the default repetition, but is followed by "?" . This is incompatible with Perl. You can also set in the mode (? U) to enable this option.
X (PCRE_EXTRA) This modifier enables additional features that are not compatible with Perl in a pcre. Any backslash followed by a letter with no special meaning in the mode leads to an error, so that this combination is retained for future expansion. By default, like Perl, a backslash followed by a letter without special meaning is treated as the letter itself. No other features are currently controlled by this modifier. That is: greedy mode. The maximum match is:/a [\ w] +? E/U matches abceade in abceadeddd instead of abce. If U correction is not added, it matches abce u (PCRE_UTF8). This modifier enables an additional feature that is incompatible with Perl in a pcre. The pattern string is treated as a UTF-8. This modifier is available in Unix from PHP 4.1.0 and win32 from PHP 4.2.3.