Javascript Regular Expressions Test()

Description

Javascript Regular Expressions Test()


// Testing to see if a pattern match will be found.
let myRegexp = /Java(Script)?/g;
let myString = "Both Java and JavaScript share the same name, but are quite different.";

console.log( myRegexp.test(myString) );  // true



PreviousNext

Related