O'Reilly logo

Java 9 Regular Expressions by Anubhava Srivastava

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Embedded regular expression mode modifiers

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required