create regex from string code example
Example 1: les fonctions reguliere javascript
if(! pseudo.match(/^([a-zA-Z ]+)$/))
alert('Pseudo invalide');
Example 2: using regex in javascript
//Adding '/' around regex
var regex = /\s/g;
//or using RegExp
var regex = new RegExp("\s", "g");
Example 3: console regex
console\.log\(([^)]+)\);