O'Reilly logo

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

Hands-On Java Regular Expressions

Video Description

Use the power of Java Regex to search, edit and manipulate text from scratch

About This Video

  • A hands-on guide to learning the most important parts of developing Regular Expressions with Java 12
  • Leverage the most powerful Regex APIs: Matcher and Pattern
  • Make your Regular Expression robust using built-in constructs into Java 12 Regex API

In Detail

Regular expressions (Regex) are specially encoded text strings, which are used as patterns for matching sets of strings. The search pattern can be anything from a simple character, a fixed string, or a complex expression containing special characters describing the pattern. It can also be used to search, edit, and manipulate text.

This course will help you get up and running with Regular expressions in Java 12. You’ll begin with the basics of Regular Expressions (Regex), which covers the topics with a hands-on approach. We’ll also cover the prerequisites required such as JUnit. With the help of practical Java Regex examples, get complete insights into the rules to write regular expressions. You will use regular expressions with String methods and cover Pattern and Matcher for advanced regular expressions.

By the end of the course, you’ll be able to master Regular Expressions with Java 12 Regex API.

Downloading the example code for this course: You can download the example code files for this course on GitHub at the following link: https://github.com/PacktPublishing/Hands-On-Java-Regular-Expressions. If you require support please email: customercare@packt.com

Table of Contents

  1. Chapter 1 : Getting Started with Java Regular Expressions API
    1. The Course Overview 00:02:23
    2. Setup Prerequisites of the Course: JUnit 00:03:24
    3. Writing Code that Operates on Pattern and Matcher 00:05:00
    4. Matching String Literals 00:03:31
    5. Adding Metacharacters to Regular Expressions 00:04:41
    6. Parameterized Unit Testing Using JUnit 00:04:30
  2. Chapter 2 : Using Pattern Classes with Character
    1. Using OR Class in the Regex 00:04:30
    2. Negating OR with NOR Class 00:03:06
    3. Matching Multiple Characters with Ranges 00:04:21
    4. Union and Intersection Class for Matching a Subset of Data 00:03:03
    5. Using Predefined Character Classes 00:04:39
  3. Chapter 3 : Using Quantifiers with Capturing Groups
    1. Using Quantifiers for Matching a Specific Number of Elements 00:05:44
    2. Creating a Capturing Group to Treat a Group of Characters as a Unit 00:03:57
    3. Repeating Regex Multiple Times 00:04:16
    4. Using Backreference to Solve More Complex Problems 00:04:45
  4. Chapter 4 : Boundary Matchers and Pattern Class Methods
    1. Using Boundary Matcher to Match the Beginning and End of the Line 00:03:59
    2. Creating Regex with Word Boundary 00:03:44
    3. Leveraging Pattern.CASE_INSENSITIVE and Pattern.CANON_EQ 00:04:39
    4. Using Pattern.COMMENTS in the Regex 00:03:02
    5. Using Pattern.LITERAL and Pattern.MULTILINE 00:04:53
  5. Chapter 5 : Solving Most Complex Problems with Matcher Class Methods
    1. Using Matcher Index for Retrieving Matched Index 00:04:47
    2. Leveraging Study Method for Checking the Presence of Elements 00:03:41
    3. Replacing Content Using Regex with Replacement Methods 00:04:51
    4. Matching Date Format with Regular Expressions 00:05:53
    5. Tweaking Regex Performance 00:07:24