JavaScript RegExp.prototype.exec() MethodThe exec() method returns an array containing all the matched groups. It executes a search for a match in a specified string. If it finds a match, it returns an array. Otherwise, it returns null. SyntaxParametersstring : The string to be searched. Return valueIt will return the array if a match is found. Otherwise, it will return null. Example 1Test it NowOutput: Test 1 - returned value : script Example 2Test it NowOutput: Test 2 - returned value : null Example 3Test it NowOutput: Returned value : script Returned value : language
Next TopicJavaScript RegExp
|