Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
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.
If this modifier is set, the expression is case-insensitive.
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.
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.
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.
If this modifier is set, preg_replace () will be replaced normally in the replacement value.
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.