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