The challenge makes it clear that “the ( + ) after the selector allows this regular expression to match one or more digits”; does the ‘g’ not already do this? What is the difference between ( + ) and ‘g’ in this situation?
Your code so far
// Setup var testString = "There are 3 cats but 4 dogs."; // Only change code below this line. var expression = /\d+/g; // Change this line // Only change code above this line // This code counts the matches of expression in testString var digitCount = testString.match(expression).length;