Regex link is https://regex101.com/r/xAQoU0/4. There it finds two matches.
const regex = /\$\$\[([(a-z-A-Z.)]*)]/;
const str = "<p>I have $$[worksAmount] works and $$[reviewsAmount] reviews</p>";
const match = regex.exec(str);
console.log(match)
But, when I run this snippet it logs in console only first match. So how to get all matches?