DEV Community

0 seconds of 13 minutes, 35 secondsVolume 90%
Press shift question mark to access a list of keyboard shortcuts
00:00
00:00
13:35
 
James Bubb
James Bubb

Posted on

5 4

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

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay