The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Get started with regular expressions in javascript

Get started with regular expressions in javascript

6:00
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.
Watch this lesson now
Avatar
egghead.io

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.

Avatar
EBIA

2 Important points: ECMA 6 is required (e.g. because of String templates) and app.js must be located at the buttom (after pre tags).

In reply to egghead.io
Avatar
Wayne

Good stuff

I especially like the little results viewer using css...nice!

Avatar
Jesse

How are you able to console.log() ["is", index: 5, input : "Is this This?"] from regex.exec(str)? I'm only able to log ["is"] without any of the other elements in the array

Avatar
Weng Koon

Hi how do you run your code? can't run in JSbin, the browser will complain

Line 1: Use the function form of "use strict".
Line 3: 'const' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).
Line 3: 'arrow function syntax (=>)' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).
Line 3: Unmatched '{'.
Line 5: Unexpected '`'.

In reply to egghead.io
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?