regular exprestion js code example
Example 1: expresiones regulares javascript
var text = "este es un texto de prueba";
var regEx = /este/gi;
console.log(regEx.test(text)) // true
Example 2: regular expression javascript
// Tests website Regular Expression against document.location (current page url)
if (/^https\:\/\/example\.com\/$/.exec(document.location)){
console.log("Look mam, I can regex!");
}