Regex in Javascript

31 minutes

Regular expressions are a useful tool for dealing with text data. They allow us to slice and dice strings, and useful extract information in our applications.

Regex is also complex, and many developers will spend their entire career looking up even the most trivial of regex operations.

This course will help improve your regex skills, and teach a solid core of useful tools that you can use every day with confidence!

pro-course-rss-logo

PRO RSS Feed

Get started with regular expressions in javascript

Find plain text patterns using regular expressions

P

Use regular expressions to find repeated patterns

P

Use character classes in regular expressions

P

Use shorthand regular expression character classes

P

Create capture groups in regular expressions

P

Use lookaheads in regular expressions

P

Use regular expression word boundaries

P

Use backreferences in regular expressions

P

Find patterns at the start and end of lines with line anchors in regular expressions

P
js tutorial about Get started with regular expressions in javascript

Get started with regular expressions in javascript

6:00 js

In this lesson we'll learn two ways to construct a Regular Expression in Javascript, explore the methods available to us directly from the RegExp constructor, use Regular Expressions with String.prototype methods, and build a simple regex highlighter.

js tutorial about Find plain text patterns using regular expressions

Find plain text patterns using regular expressions

2:29 js PRO

The simplest use of Regular Expressions is to find a plain text pattern. In this lesson we'll look at at finding plain text patterns as well as using the metacharacter "." and how to escape a metacharacter.

js tutorial about Use regular expressions to find repeated patterns

Use regular expressions to find repeated patterns

3:53 js PRO

Regular Expression Quantifiers allow us to identify a repeating sequence of characters of minimum and maximum lengths. In this lesson we'll use Regular Expression Quantifiers to match repeated patterns, common Quantifier patterns, and using shorthand for those common Quantifier patterns.

js tutorial about Use character classes in regular expressions

Use character classes in regular expressions

2:41 js PRO

Regular Expression Character Classes define a group of characters we can use in conjunction with quantifiers.

js tutorial about Use shorthand regular expression character classes

Use shorthand regular expression character classes

1:42 js PRO

In this lesson we'll learn shorthands for common character classes as well as their negated forms.

js tutorial about Create capture groups in regular expressions

Create capture groups in regular expressions

4:35 js PRO

In this lesson we'll capture groups of characters we wish to match, use quantifiers with those groups, and use references to those groups in String.prototype.replace.

js tutorial about Use lookaheads in regular expressions

Use lookaheads in regular expressions

1:27 js PRO

Lookaheads allow us to match a pattern followed by another pattern without including the second pattern in our match.

js tutorial about Use regular expression word boundaries

Use regular expression word boundaries

2:18 js PRO

Regular Expression Word Boundaries allow to perform "whole word only" searches within our source string.

js tutorial about Use backreferences in regular expressions

Use backreferences in regular expressions

3:31 js PRO

Regular Expression Backreferences provide us a method to match a previously captured pattern a second time.

js tutorial about Find patterns at the start and end of lines with line anchors in regular expressions

Find patterns at the start and end of lines with line anchors in regular expressions

3:19 js PRO

We can identify the start and end of a line using Line Anchors. When dealing with multiple line matches we can utilize the multiline regular expression flag.

Presented by:

Joe Maddalone

Joe is a father of five, lives in Chicago, works as a freelance web developer, shares coding tutorials on egghead.io, and codes for fun when not for work.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?