模式名称
| 启用,禁用
| 缺省启用
| 说明
|
UNIX_LINES
| (?d)启用,(?-d)禁用
| 是
| 启用Unix行模式。 在此模式下,只有 '\n'被认为是行结束符。它会影响., ^, 和 $ 的行为。
|
CASE_INSENSITIVE
| (?i)启用,(?-i)禁用
| 否
| 启用忽略大小写模式。 缺省时,忽略大小写模式只会影响 ASCII字符的匹配。 而Unicode范围的忽略大小写匹配需要通过 UNICODE_CASE 标志与本标志联合使用。 启用此模式会影响匹配性能。
|
COMMENTS
| (?x)启用,(?-x)禁用
| 否
| 允许空格和注释出现在正则表达式中。 在此模式下,空格被忽略,以#开始的单行注释被忽略。
|
MULTILINE
| (?m)启用,(?-m)禁用
| 是
| 启用多行模式。 In multiline mode the expressions ^ and $ match just after or just before, respectively, a line terminator or the end of the input sequence. By default these expressions only match at the beginning and the end of the entire input sequence.
|
DOTALL
| (?s)启用,(?-s)禁用
| 否
| 让.可以匹配行结束符。 在此模式下,元字符.可以匹配行结束符。缺省不允许如此匹配。
|
UNICODE_CASE
| (?u)启用,(?-u)禁用
| 否
| Enables Unicode-aware case folding. When this flag is specified then case-insensitive matching, when enabled by the CASE_INSENSITIVE flag, is done in a manner consistent with the Unicode Standard. By default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched. 启用此模式会影响性能。
|
CANON_EQ
| (?c)启用,(?-c)禁用
| 否
| Enables canonical equivalence. When this flag is specified then two characters will be considered to match if, and only if, their full canonical decompositions match. The expression "a\u030A", for example, will match the string "?" when this flag is specified. By default, matching does not take canonical equivalence into account. 启用此模式会影响性能。
|