Pattern Modifiers-modifier of the Rule expression
The following are the modifiers available in the current rule expression. The names in the brackets are the internal PCRE names of the modifiers.
I (PCRE_CASELESS)
If this modifier is set, the expression is case-insensitive.
M (PCRE_MULTILINE)
By default, PCRE considers the target string value as a single-line string (even if it does contain multiple rows ). the row start mark (^) matches only the start part of the string, while the row end mark ($) matches only the end of the string, or an end line (unless the E modifier is specified ). this is the same as that in Perl.
If this modifier is set, the row start and end structures match the current position or the previous one after any new row of the target string, the same as each start and end. this is equal to the/m modifier in Perl. if the target string does not contain the "n" character, or the mode does not contain the ^ or $ character, this modifier does not work.
S (PCRE_DOTALL)
If this modifier is set, a "dot" in the mode will match all characters, including line breaks. without him, the line feed will be excluded. this modifier is equivalent to the/s modifier in Perl. the opposite type. For example, [^ a] will always match the line feed character, regardless of the modifier restrictions.
X (PCRE_EXTENDED)
If this modifier is set, all spaces in the mode will be ignored, unless the escape character or internal type of a character is used, the number of unescaped # characters other than the character type is also ignored. this is equivalent to the/x modifier in Perl. In this way, annotations can be added to complicated patterns. note: Only applicable to data characters. space characters are not displayed in the specified sequence of pattern characters.
E
If this modifier is set, preg_replace () will be replaced normally in the replacement value, equivalent to the same in the PHP code, and then used to replace the searched string.
This modifier is used only in preg_replace (). Other PCRE functions ignore this modifier.
A (PCRE_ANCHORED)
If this modifier is set, the mode is forced to be anchored, that is, it matches the value to the start of the search string. this effect can be achieved through the appropriate schema structure itself, which is the only way in Perl.
D (PCRE_DOLLAR_ENDONLY)
If this modifier is set, the $ modifier in the mode will only match the tail of the target string. without this modifier, the $ character also matches the end of the new line (but no longer before the new line ). if the m modifier is set, this modifier is ignored. there is no such thing in Perl.
S
If a pattern is used multiple times, it takes a long time to analyze it to increase the matching speed. if this modifier is used, additional analysis is performed. currently, the research mode is only used in non-anchor mode and does not have a fixed start character.
U (PCRE_UNGREEDY)
This modifier is used to flip the number of "greediness" so that greedy is disabled by default. However, if you follow the question mark (?), You can use greedy. This is incompatible with Perl. This can also be done through (? U) modifier to get.
X (PCRE_EXTRA)
This modifier enables additional features that are incompatible with Perl. any backslash with characters but no special meaning in any mode will cause an error, so as to reserve the Union for future expansion. by default, in Perl, meaningful characters after the backslash are treated as normal literal. no other control features