wiki/content/20201104101924-javascript_regexp_exec_method.md

497 B

date id title
20201104 879b1425-8e59-4a5b-a2d8-08838e193b88 JavaScript RegExp Exec Method

exec1 returns null if no match was found or an object with information about the match otherwise:

let match = /\d+/.exec("one two 100");
console.log(match);
console.log(match.index);

See also

Footnotes