RegEx - vijayetar/seattle-301d55 GitHub Wiki

Reg Ex is regular expressions and it is useful to match patterns

Get information for regEx here.
The method that is using is .test with regex format.

How do we test for it?

const str = "I am a string that may or may not contain numbers";
let regex = /\d/g;
regex.test(str);
returns the answer as a Boolean true or false

Syntax to use regex is let regex = "/../gi"
g is global and i is case insensitive

How do you use .replace

const str = '23alka sd47alkj 55asdk"
let regex = /\s/g
str.replace(regex, '-dog-');