ES6 RegExp exec() ES6 RegExp.prototype.sticky ES6 RegExp test() ES6 RegExp exec() var str = "Javascript is an interesting scripting language"; var re = new RegExp( "script", "g" ); var result = re.exec(str); console.log("Test 1 - returned value : " + result); re = new RegExp( "pushing", "g" ); var result = re.exec(str); console.log("Test 2 - returned value : " + result) ES6 RegExp.prototype.sticky ES6 RegExp test()