Like all other regular expression flavors, Java also allows the embedding of some standard modes in the regular expression itself. These mode modifiers are used to change regular expression behavior in a certain manner. In the following table, we will list all these modes and their meaning:
Mode | Name | Meaning |
(?i) | Ignore case mode | Enables case-insensitive matching for US-ASCII text |
(?s) | DOTALL mode | Makes DOT match all the characters, including line breaks |
(?m) | Multiline mode | Makes the carrot and dollar match the start and end of each line in a multiline input |
(?u) | Unicode-aware case folding | Enables Unicode-aware case folding |
(?U) | Unicode matching | Enables the Unicode version of predefined ... |