--- id: 587d7db7367417b2b2512b9f title: Match All Letters and Numbers challengeType: 1 videoUrl: '' localeTitle: Corresponder todas as letras e números --- ## Description
Usando classes de caracteres, você conseguiu pesquisar todas as letras do alfabeto com [az] . Esse tipo de classe de caracteres é comum o suficiente para que haja um atalho para ele, embora inclua alguns caracteres extras também. A classe de caractere mais próxima em JavaScript para corresponder ao alfabeto é \w . Este atalho é igual a [A-Za-z0-9_] . Essa classe de caracteres corresponde a letras maiúsculas e minúsculas mais números. Note que esta classe de caracteres também inclui o caractere de sublinhado ( _ ).
let longHand = / [A-Za-z0-9 _] + /;
deixe shortHand = / \ w + /;
deixe números = "42";
deixe varNames = "important_var";
longHand.test (números); // Retorna true
shortHand.test (números); // Retorna true
longHand.test (varNames); // Retorna true
shortHand.test (varNames); // Retorna true
Essas classes de caracteres de atalho também são conhecidas como shorthand character classes .
## Instructions
Use a classe de caractere abreviada \w para contar o número de caracteres alfanuméricos em várias aspas e cadeias de caracteres.
## Tests
```yml tests: - text: Seu regex deve usar o sinalizador global. testString: 'assert(alphabetRegexV2.global, "Your regex should use the global flag.");' - text: Seu regex deve usar o caractere abreviado testString: 'assert(/\\w/.test(alphabetRegexV2.source), "Your regex should use the shorthand character \w to match all characters which are alphanumeric.");' - text: Seu regex deve encontrar 31 caracteres alfanuméricos em "The five boxing wizards jump quickly." testString: 'assert("The five boxing wizards jump quickly.".match(alphabetRegexV2).length === 31, "Your regex should find 31 alphanumeric characters in "The five boxing wizards jump quickly."");' - text: Seu regex deve encontrar 32 caracteres alfanuméricos em "Pack my box with five dozen liquor jugs." testString: 'assert("Pack my box with five dozen liquor jugs.".match(alphabetRegexV2).length === 32, "Your regex should find 32 alphanumeric characters in "Pack my box with five dozen liquor jugs."");' - text: Seu regex deve encontrar 30 caracteres alfanuméricos em "How vexingly quick daft zebras jump!" testString: 'assert("How vexingly quick daft zebras jump!".match(alphabetRegexV2).length === 30, "Your regex should find 30 alphanumeric characters in "How vexingly quick daft zebras jump!"");' - text: Seu regex deve encontrar 36 caracteres alfanuméricos em "123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ." testString: 'assert("123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ.".match(alphabetRegexV2).length === 36, "Your regex should find 36 alphanumeric characters in "123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ."");' ```
## Challenge Seed
```js let quoteSample = "The five boxing wizards jump quickly."; let alphabetRegexV2 = /change/; // Change this line let result = quoteSample.match(alphabetRegexV2).length; ```
## Solution
```js // solution required ```