Regular Expressions
Learn about regular expressions (or "regex") in Java.
StartRegular Expressions: Lesson
Lesson 1 of 1
- 1Have 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,…
- 2Java’s java.util.regex package contains two vital classes: - Pattern Class - Matcher Class We’ll start with the Pattern class which is what we use to define a pattern we want to find in a string…
- 3The Matcher class 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. The syntax for the Matcher clas…
- 4Character 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…
- 5We discussed character classes as one of the means to group characters in regex. The other is known as a **…
- 6Remember 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…
- 7Alternation is just the regex way of saying OR. In regex, this is denoted by the following (note the “ab”…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory