DEV Community

Play Button Pause Button
James Bubb
James Bubb

Posted on

JavaScript RegEx Exercises 01

Get the exercises here: https://gist.github.com/codebubb/bb19d7ae24cd41695cb3c5ec3b1155d5

01:06 Exercise 1 (Final Answer 05:22)
05:49 Exercise 2 (Final Answer 06:42)
07:00 Exercise 3 (Final Answer 08:33)
09:13 Exercise 4 (Final Answer 10:57)
11:15 Exercise 5 (Final Answer 12:42)

— Follow Me —
Twitter: https://www.twitter.com/codebubb
Facebook: https://www.facebook.com/juniordevelopercentral/
Blog: https://www.juniordevelopercentral.com/
— Thanks! —

In these JavaScript RegEx tutorials you'll get the chance to learn a bit about RegEx in JavaScript and how you might use it to process or extract data in strings.

There are a number of instances when you might want to match a pattern in a string within your JavaScript code and these 5 exercises will show you some examples of when you might want to do this and also how you would go about doing with a JavaScript Regular Expression.

Although Regular Expressions aren't exclusive to JavaScript there are some specific JavaScript functions like the JavaScript match and JavaScript replace functions which allow you to use a Regular Expression to match a pattern within the string the function is used with.

The examples in the exercises are a bit contrived but they've been designed so you get a bit of exposure to some of the basic operations that can be done with RegEx patterns.

If you enjoy this tutorial, check out some of the other Junior Developer Central JavaScript practice exercises in the series: https://www.youtube.com/watch?v=N65RvNkZFGE&list=PLpc_YvcwbxaSn6jn0VaTcG8A0Grgs1GSB

Top comments (0)