JavaScript RegEx Exercises 01

preview_player
Показать описание
In this tutorial you'll get the chance to have a go at some JavaScript RegEx Exercises to improve both your JavaScript and RegEx knowledge!

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 —
— 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.

#JavaScript #RegEx Channel Handle @codebubb
Рекомендации по теме
Комментарии
Автор

Yaay, was looking forward to this tutorial. Thanks .

mahmudurrahman
Автор

Hi James, great video! Quick question ... would it be cleaner to use the word boundary \b assertion instead for question 1?

ex1.match(/\b[a-zA-Z]{3}\b/g)

davidpocsai
Автор

Hey, Thank you so much - this was exactly what I needed to get a better understanding of regEx! I loved how you explained every step and what it does or not does, so I could follow along - before I was just looking at solutions and not understanding what they were doing.
My solution for exercise 5 was:
So my approach was finding any @ that is followed and preceded by something else. Do you reckon thats a practical solution aswell or is there a downside to it when used in real life?

phoenixlpfan