Match Characters that Occur Zero or More Times 77

Tell us what’s happening:

this isn’t working

Your code so far


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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 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

the string you are given starts with a capital A
so you need to be more precise in the matching… (your current regex can match lower case a at the start of the string for example which is not what the given string begins with).

So the hint here is: think more specifically about the given string. Match that and nothing else.

2 Likes