Regular Expressions: Lesson
Lesson 1 of 1
  1. 1
    Have you ever wondered how search engines like Google Search can interpret the text you type and return results accurately to your inquiry? Aside from the higher-level steps of crawling, indexing,…
  2. 2
    Java’s java.util.regex package contains three vital classes: - Pattern Class - Matcher Class - PatternSyntaxException Class We’ll start with the Pattern class. This class is Java’s way to defin…
  3. 3
    The butter to our bread is the Matcher class. This is Java’s “search” feature, allowing it to take a regular expression defined by the Pattern class and perform a search based on a compiled pattern…
  4. 4
    Character classes are one of the primary means of “grouping” characters in a regex pattern without necessarily enforcing an order to those characters. For instance, a character class marks the diff…
  5. 5
    We talked about character classes as one of the means to group characters in regex. The other is known as a capture group. Capture groups maintain the order but allow you to section the pattern…
  6. 6
    Remember that + character used in the character class example? That’s what regex calls a quantifier. Quantifiers look at preceding tokens and indicate how many matches to look for, defaulting to…
  7. 7
    Alternation is just the regex way of saying OR. In regex, this is denoted by the following (note the “ab” and “cd” are user-defined): | Alternation | Description | | — | — | | ab|cd | Match…
  8. 8
    Congratulations! You completed the lesson on Regex! 🙌 Key concepts covered in this lesson include: - The Pattern Class - The Matcher Class - The PatternSyntaxException Class - Character Classe…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo