expresiones regulares javascript 1

expresiones regulares javascript

var text = "este es un texto de prueba";
var regEx = /este/gi;

console.log(regEx.test(text)) // true

Here is what the above code is Doing:
1. We create a variable called text and assign it a string value.
2. We create a variable called regEx and assign it a regular expression.
3. We use the test() method to test whether the regular expression matches the string.

Similar Posts