Posted inStandard Objects: RegExp
How to extract all matches using regex in JavaScript
The string.match method returns matched substrings or null, with behavior dependent on the global flag. Without 'g', it returns the first match and capturing groups. With 'g', it returns all matches without groups. For capturing groups on all matches, use RegExp.exec in a loop or matchAll with 'g'.
