<sectionid="description"> En el último desafío, aprendiste a usar el carácter de <code>caret</code> para buscar patrones al principio de las cadenas. También hay una forma de buscar patrones al final de las cadenas. Puede buscar el final de las cadenas con el <code>dollar sign</code><code>$</code> al final de la expresión regular. <blockquote> Let theEnding = "Esta es una historia interminable"; <br> Deje storyRegex = / story $ /; <br> storyRegex.test (theEnding); <br> // Devuelve true <br> Deje que noEnding = "A veces una historia tenga que terminar"; <br> storyRegex.test (noEnding); <br> // Devuelve falso <br></blockquote></section>
<sectionid="instructions"> Utilice el carácter de ancla ( <code>$</code> ) para que coincida con la cadena <code>"caboose"</code> al final de la cadena <code>caboose</code> . </section>
- text: Debe buscar <code>"caboose"</code> con el signo de dólar <code>$</code> ancla en su expresión regular.
testString: 'assert(lastRegex.source == "caboose$", "You should search for <code>"caboose"</code> with the dollar sign <code>$</code> anchor in your regex.");'
- text: Su expresión regular no debe usar ninguna bandera.
testString: 'assert(lastRegex.flags == "", "Your regex should not use any flags.");'
- text: Debe coincidir con <code>"caboose"</code> al final de la cadena <code>"The last car on a train is the caboose"</code>
testString: 'assert(lastRegex.test("The last car on a train is the caboose"), "You should match <code>"caboose"</code> at the end of the string <code>"The last car on a train is the caboose"</code>");'
```
</section>
## Challenge Seed
<sectionid='challengeSeed'>
<divid='js-seed'>
```js
let caboose = "The last car on a train is the caboose";