\d , con una d minúscula. Esto es igual a la clase de caracteres [0-9] , que busca un solo carácter de cualquier número entre cero y nueve. \d para contar cuántos dígitos hay en los títulos de las películas. Los números escritos ("seis" en lugar de 6) no cuentan. "9" .
testString: 'assert("9".match(numRegex).length == 1, "Your regex should find 1 digit in "9".");'
- text: Su expresión regular debe encontrar 2 dígitos en "Catch 22" .
testString: 'assert("Catch 22".match(numRegex).length == 2, "Your regex should find 2 digits in "Catch 22".");'
- text: Su expresión regular debe encontrar 3 dígitos en "101 Dalmatians" .
testString: 'assert("101 Dalmatians".match(numRegex).length == 3, "Your regex should find 3 digits in "101 Dalmatians".");'
- text: 'Su expresión regular no debe encontrar dígitos en "One, Two, Three" .'
testString: 'assert("One, Two, Three".match(numRegex) == null, "Your regex should find no digits in "One, Two, Three".");'
- text: Su expresión regular debe encontrar 2 dígitos en "21 Jump Street" .
testString: 'assert("21 Jump Street".match(numRegex).length == 2, "Your regex should find 2 digits in "21 Jump Street".");'
- text: 'Su expresión regular debe encontrar 4 dígitos en "2001: A Space Odyssey" .'
testString: 'assert("2001: A Space Odyssey".match(numRegex).length == 4, "Your regex should find 4 digits in "2001: A Space Odyssey".");'
```