A regular expression, or regex, is a sequence of characters that specifies a pattern which can be searched for in a text. A regex defines a set of strings, usually united for a given purpose.

About Our Java Regular Expressions Cheat Sheet

This cheat sheet contains the most useful classes, API, and syntax definitions for Java regex, including:

  • Character classes
  • Boundary matches
  • Pattern Flags
  • Patterns
  • Matchers
  • Quantifiers
  • Groups and Backreferences
  • Logical Operations

Download the Cheat Sheet

Ready to download the Java regular expressions cheat sheet? Click the button below to download the printable pdf version.