Short course

JavaScript RegExp

Matching patterns within strings in JavaScript

Intermediate
2 hrs 54 mins
12 chapters

Overview

Regular expressions, or simply regex, is a pattern-matching technology used widely across programming languages with the string data type to carry out complex searching. Regular expressions can be used to find simple to extremely complicated patterns within strings and extract them out in order for further processing.

Where string-based searching finds its stop, regex-based searching finds its start. Regular expressions are extremely powerful, useful and time-saving. Theoretically, they aren't very complicated to understand, however, if not understood the right way, they can quickly become really ugly!

This course teaches you how to work with regular expressions specifically in JavaScript. That is, you'll get to explore the built-in RegExp interface; how to construct regular expressions in JavaScript; how to change between fixed and dynamic expressions; and so on. You will learn a lot of concepts in the way and actually learn regular expressions the right way.

Prerequisites

  • JavaScript

    This course explores regular expressions in JavaScript, likewise knowledge of the core language is required.

Learning outcomes

  • How to construct regular expressions for basic search patterns.
  • How to work with the RegExp interface in JavaScript.
  • How to craft regular expressions leveraging such diverse ideas as character sets, character classes, assertions and boundaries.
  • How to use flags to modify searching behavior to solve a wider array of searching problems.
  • What is grouping and backreferencing, and how they're vital to storing matched portions in a search and then operating on them.
  • How to analyze a searching problem and then design a regular expressions to test for it.

Table of contents

FAQs

Not at all! There are not many things to learn in regular expressions; you can easily get fluent with understanding and creating regular expressions in just over a week.

While regular expressions aren't directly necessary in order to become a JavaScript developer, once you do learn them, you'll gain a lot of potential; learning regular expressions will supercharge your programming career. And most importantly, they aren't just limited to JavaScript; you can apply similar ideas to other programming languages as well.

If you're having a hard time understanding a given concept in the course, feel free to reach out to me at bilal@codeguage.com, describing the issue you're facing. I'll try my level best to help you out.

The courses on Codeguage are released while they are still under construction so that learners can get early previews. As I continuously work on adding more and more content to the courses, if a given topic isn't covered today, there's a high chance that it's already under way and will show up very soon. You can follow Codeguage on Twitter to be updated with all the latest content releases.

Write to me at bilal@codeguage.com.

Let's get learning!

Start learning

Recent courses

Pre-release

Node.js

A runtime environment executing JavaScript outside the browser