regex in javascript w3schools code example
Example 1: using regex in javascript
//Adding '/' around regex
var regex = /\s/g;
//or using RegExp
var regex = new RegExp("\s", "g");
Example 2: regular expression in javascript
let re = /ab+c/;
//Adding '/' around regex
var regex = /\s/g;
//or using RegExp
var regex = new RegExp("\s", "g");
let re = /ab+c/;