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

Understanding the core constructs of regular expressions

Certain special character constructs are allowed literally in Java regular expressions. Here they are:

Special Character Meaning
\0c A character with the octal value c
\0cc A character with the octal value cc
\0ncc A character with the octal value ncc, where n cannot be more than 3
\xhh A character with the hexadecimal value 0xhh
\uhhhh A character with the hexadecimal value 0xhhhh
\x{h...h} A character with the hexadecimal value 0xh...h, where h must be a valid CODE_POINT
\n Newline character or u000A
\t Tab character or u0009
\r Carriage return character or u000D
\f Form feed character or u000C
\e Escape character or u\u001B
\a Bell character or \u0007

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