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

The placement of embedded modes in a Java regular expression

All the aforementioned embedded modes can be placed at the start of a regular expression to enable one or more modes for the complete regular expression. We can also place these modes in the middle of a regex to enable it for a specific group or a remainder of the regex pattern.

We can also combine multiple mode modifiers into a single expression like this:

    (?is)

This enables the DOTALL and ignore case modes.

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