© Kishori Sharan and Adam L. Davis 2022
K. Sharan, A. L. DavisBeginning Java 17 Fundamentalshttps://doi.org/10.1007/978-1-4842-7307-4_18

18. Regular Expressions

Kishori Sharan1   and Adam L. Davis2
(1)
Montgomery, AL, USA
(2)
Oviedo, FL, USA
 
In this chapter, you will learn:
  • How to create regular expressions

  • How to use convenience methods in the String class to perform regular expression–based find-and-replace

  • How to use the Pattern class to compile regular expressions

  • How to use the Matcher class to match a regular expression against an input string

  • How to use groups in regular expressions

  • How to perform advanced find-and-replace using the Matcher class

All example programs in this chapter are a member of a jdojo.regex module, as declared in Listing 18-1

Get Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 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.