Understanding the Core Constructs of Java Regular Expressions

Using Java as a regular expression flavor, in this chapter, we will go a bit deeper and learn in detail about anchors, quantifiers, boundary matchers, all the available character classes, negated character classes, predefined character classes, and character classes escaping rules, using Java as a reference point. You will also learn Unicode text matching, using regular expressions in Java. We will also cover greedy versus non-greedy (lazy matching) and the change of regular expression behavior with lazy matching.

We will cover the following topics in this chapter:

  • Anchors and quantifiers
  • Boundary matchers
  • Character classes
  • Regex escaping rules
  • Escaping inside character classes ...

Get Java 9 Regular Expressions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.