I am going to find all 'aa' sub-strings in the 'caaab'. So, I've used the following regular expression.
/aa/g
Using the cited expression, I expect that JavaScript's match method returns two correspondent patterns. As you can see, the middle, shared 'a' causes two 'aa' patterns! Nonetheless, it merely returns the first one. What is the problem with the Regex, and how can I fix it?
let foundArray=d.match(/aa/g);