match regex string boolean javscript code example
Example: javascript boolean regex match
//RegExp.prototype.test()
str = 'ok';
regex = /ok/;
console.log(regex.test(str)) // => true
//RegExp.prototype.test()
str = 'ok';
regex = /ok/;
console.log(regex.test(str)) // => true