\d
con una minúscula d
. También puede buscar no dígitos usando un atajo similar que use una D
mayúscula en su lugar. El atajo para buscar caracteres sin dígitos es \D
Esto es igual a la clase de caracteres [^0-9]
, que busca un solo carácter que no sea un número entre cero y nueve. \D
para contar cuántos no dígitos hay en los títulos de las películas. "9"
.
testString: 'assert("9".match(noNumRegex) == null, "Your regex should find no non-digits in "9"
.");'
- text: Su expresión regular debe encontrar 6 no dígitos en "Catch 22"
.
testString: 'assert("Catch 22".match(noNumRegex).length == 6, "Your regex should find 6 non-digits in "Catch 22"
.");'
- text: Su expresión regular debe encontrar 11 no dígitos en "101 Dalmatians"
.
testString: 'assert("101 Dalmatians".match(noNumRegex).length == 11, "Your regex should find 11 non-digits in "101 Dalmatians"
.");'
- text: 'Su expresión regular debe encontrar 15 no dígitos en "One, Two, Three"
.'
testString: 'assert("One, Two, Three".match(noNumRegex).length == 15, "Your regex should find 15 non-digits in "One, Two, Three"
.");'
- text: Su expresión regular debe encontrar 12 no dígitos en "21 Jump Street"
.
testString: 'assert("21 Jump Street".match(noNumRegex).length == 12, "Your regex should find 12 non-digits in "21 Jump Street"
.");'
- text: 'Su expresión regular debe encontrar 17 dígitos no en "2001: A Space Odyssey"
.'
testString: 'assert("2001: A Space Odyssey".match(noNumRegex).length == 17, "Your regex should find 17 non-digits in "2001: A Space Odyssey"
.");'
```