Match Characters that Occur Zero or More Times :I

Tell us what’s happening:

Hi

Please can someone tell me how the code selects the “Aaaaaaaaaaaaaaaarrrgh!”. I get how it doesn’t select the other words. ( I had to remove the i from gi which was causing me problems ). though not sure how it select for the word we want.

Create a regex chewieRegex that uses the * character to match all the upper and lower "a" characters in chewieQuote . Your regex does not need flags, and it should not match any of the other quotes.

Thank you

Your code so far


let chewieQuote = "Aaaaaaaaaaaaaaaarrrgh!";
let chewieRegex = /Aa*/g; // Change this line
let result = chewieQuote.match(chewieRegex);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-zero-or-more-times

Your expression only matches a string containing a captial ‘A’ followed by zero or more lower-case 'a’s. None of the other other words have a captial ‘A’.