let regex = /*pattern*/[*flags*]
let regex = new RegExp(*'pattern'*, [*flags*])
let ismatch = regex.test(*'text'*)
let results = regex.exec('*text'*)
The RegExp object is only as useful as your knowledge of Regular Expressions is strong. See here for an introductory primer, or see MDN for a more in-depth explanation.
Check if string contains pattern using .test
Replacing string match with a callback function
Using Regex.exec with parentheses regex to extract matches of a string