Link Search Menu Expand Document

Match All Numbers

Summary

  • \d can be used to look for digit characters.

Final Code

let movieName = "2001: A Space Odyssey";
let numRegex = /\d/gi; // Change this line
let result = movieName.match(numRegex).length;