--- id: 587d7db7367417b2b2512b9e title: Match Ending String Patterns challengeType: 1 videoUrl: '' localeTitle: Padrões de Sequência de Correspondência Final --- ## Description
No último desafio, você aprendeu a usar o caractere de caret para procurar padrões no início das seqüências de caracteres. Há também uma maneira de procurar padrões no final das strings. Você pode pesquisar o final das strings usando o caractere de dollar sign $ no final da regex.
deixe theEnding = "Esta é uma história sem fim";
deixe storyRegex = / story $ /;
storyRegex.test (theEnding);
// Retorna true
deixe noEnding = "Às vezes uma história terá que terminar";
storyRegex.test (noEnding);
// Retorna falso
## Instructions
Use o caractere de âncora ( $ ) para combinar com a string "caboose" no final do caboose string.
## Tests
```yml tests: - text: Você deve procurar por "caboose" com o cifrão $ anchor no seu regex. testString: 'assert(lastRegex.source == "caboose$", "You should search for "caboose" with the dollar sign $ anchor in your regex.");' - text: Seu regex não deve usar sinalizadores. testString: 'assert(lastRegex.flags == "", "Your regex should not use any flags.");' - text: Você deve combinar "caboose" no final da corda "The last car on a train is the caboose" testString: 'assert(lastRegex.test("The last car on a train is the caboose"), "You should match "caboose" at the end of the string "The last car on a train is the caboose"");' ```
## Challenge Seed
```js let caboose = "The last car on a train is the caboose"; let lastRegex = /change/; // Change this line let result = lastRegex.test(caboose); ```
## Solution
```js // solution required ```