Learn Regular Expressions

Master the power of regular expressions with this short, six-part course.

Regex, or regular expressions, use a defined syntax to describe a search pattern. The concept came out of the field of mathematics and theoretical computer science over 50 years ago but today has a wide variety of practical applications. Many tools and programming languages make use of regular expressions. For example, Linux provides various regex compatible utilities such as sed (the stream editor) and grep. We can use regular expressions for searching across data (such as trying to find a filename that matches a specific pattern) validating strings (such as confirming an email address or date is in the correct format) and much much more.

This course will take you from being a total beginner through the basics of matching and then teach you the full power of the language.

The course includes many practical regex examples along the way to help you learn. There are lots of tools online (and offline) that you can use to experiment and try the examples. For example, RegExr evaluates regex patterns and will also breakdown and explain the regular expressions that you create.

You will learn

Topics covered in this six-part course include:

  • an introduction to regex
  • regex character classes
  • quantifiers
  • grouping
  • anchors

Course Content

lesson

What are Regular Expressions?

Regular expressions are patterns specified with a defined syntax which are used to search text for specific sequences of characters with many practical applications.

lesson

Basic Regex Character Matching

Learn how to match standard character classes with regular expressions.

lesson

Custom Sets in Regular Expressions

Learn to define your own sets of characters to be matched with a regular expression.

lesson

Matching a Certain Number of Repetitions with Regex

Use regular expressions to match on a certain number (or range) of repetions of a certain character or class of characters.

lesson

Regex Subexpressions

Subexpressions let us split a regular expression up into smaller groups which we can use for many things!

lesson

Regex Anchors

We can specify where we want to match with a regular expression using word and string boundaries.