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

Predefined zero-width assertions

Zero-width Assertion

Description

\b

Asserts a word boundary

\B

Asserts anywhere except at a word boundary

^

Asserts position only at the beginning of a line

$

Asserts position only at the end of a line

\A

Asserts position only at the beginning of a string

\z

Asserts position only at the end of a string

\Z

Asserts position only at the end of a string or before the line break at the end of a string (if present)

\G

Asserts position at the end of the previous match or at the start of the string for the very first match

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