| Pattern modifier |
Description |
| I |
Represents the match in and pattern is not case-sensitive |
| M |
Treat a pattern as multiple rows, using ^ and $ to indicate that any row can start or end with a regular expression |
| S |
If you do not use this mode to fix the symbol, the "." In the meta-character The default cannot represent a newline symbol, and the string is treated as a single line |
| X |
Whitespace in the representation pattern is ignored |
| E |
The regular expression must be used in a function that preg_replace replace the string (speaking of this function) |
| A |
Begins with a pattern string, which is equivalent to a meta-character ^ |
| Z |
Ends with a pattern string, equivalent to a meta-character $ |
| U |
The characteristics of regular expressions: is to compare "greed", using this mode modifier can cancel greedy mode |
String str = "Abcheabcllo"= Str.replaceall ("(? i) ABC", ""); //Replace search ABC ignore case other modifiers same usage (? i) (? m) (? s) (? x) ... System.out.println (str); // Output Hello
Regular mode modifier