Exec regexp javascript

Previous Page. The exec method searches string for text that matches regexp. Return Value. Syntax RegExpObject.exec( string ); Parameter Details. It returns the matched text if a match is found, and NULL if not. If it finds a match, it returns an array of results; otherwise, it returns null. ES6 - RegExp exec() Advertisements. Example var str = "Javascript is an … Next Page . String − The string to be searched.