--- id: 587d7db8367417b2b2512ba3 title: Match Whitespace challengeType: 1 videoUrl: '' localeTitle: Corresponder espaço em branco --- ## Description
Os desafios até agora cobriram letras correspondentes do alfabeto e números. Você também pode combinar o espaço em branco ou os espaços entre as letras. Você pode procurar espaços em branco usando \s , que é um s minúsculo. Esse padrão não apenas corresponde ao espaço em branco, mas também ao retorno de carro, à guia, ao feed de formulário e aos novos caracteres de linha. Você pode pensar nisso como semelhante à classe de caracteres [ \r\t\f\n\v] .
let whiteSpace = "Espaço em branco. Espaço em branco em todo lugar!"
deixe spaceRegex = / \ s / g;
whiteSpace.match (spaceRegex);
// Retorna ["", ""]
## Instructions
Altere o regex countWhiteSpace para procurar vários caracteres de espaço em branco em uma string.
## Tests
```yml tests: - text: Seu regex deve usar o sinalizador global. testString: 'assert(countWhiteSpace.global, "Your regex should use the global flag.");' - text: Seu regex deve usar o caractere abreviado testString: 'assert(/\\s/.test(countWhiteSpace.source), "Your regex should use the shorthand character \s to match all whitespace characters.");' - text: Seu regex deve encontrar oito espaços em "Men are from Mars and women are from Venus." testString: 'assert("Men are from Mars and women are from Venus.".match(countWhiteSpace).length == 8, "Your regex should find eight spaces in "Men are from Mars and women are from Venus."");' - text: 'Seu regex deve encontrar três espaços em "Space: the final frontier."' testString: 'assert("Space: the final frontier.".match(countWhiteSpace).length == 3, "Your regex should find three spaces in "Space: the final frontier."");' - text: Seu regex não deve encontrar espaços em "MindYourPersonalSpace" testString: 'assert("MindYourPersonalSpace".match(countWhiteSpace) == null, "Your regex should find no spaces in "MindYourPersonalSpace"");' ```
## Challenge Seed
```js let sample = "Whitespace is important in separating words"; let countWhiteSpace = /change/; // Change this line let result = sample.match(countWhiteSpace); ```
## Solution
```js // solution required ```