js regex from string code example
Example 1: les fonctions reguliere javascript
if(! pseudo.match(/^([a-zA-Z ]+)$/))
alert('Pseudo invalide');
Example 2: js string to regex
const regex = new RegExp('https:\\/\\/\\w*\\.\\w*.*', 'g');
Example 3: using regex in javascript
var regex = /\s/g;
var regex = new RegExp("\s", "g");
Example 4: regex for strings with specific letters javascript
let re = /ab+c/;
Example 5: regular expression javascript
if (/^https\:\/\/example\.com\/$/.exec(document.location)){
console.log("Look mam, I can regex!");
}