From 848458b142dd71d127a18fbee3e412a876369be8 Mon Sep 17 00:00:00 2001 From: greggubarev Date: Tue, 16 Oct 2018 08:21:19 +0400 Subject: [PATCH] Javascript: Add hint to Match Ending String Patterns (#19232) * Javascript: Add hint to Match Ending String Patterns Add hint to Match Ending String Patterns (https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns and https://guide.freecodecamp.org/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns/) * Update index.md --- .../match-ending-string-patterns/index.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns/index.md b/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns/index.md index d688bd9130..28480721b2 100644 --- a/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns/index.md +++ b/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns/index.md @@ -1,10 +1,17 @@ +--- +title: Match Ending String Patterns --- -title: Match Ending String Patterns ---- + ## Match Ending String Patterns -This is a stub. Help our community expand it. - -This quick style guide will help ensure your pull request gets accepted. - + +We need to use the anchor character (```$```) to match the string ```"caboose"``` at the end of the string ```caboose```. + +## Solution: + +```js +let caboose = "The last car on a train is the caboose"; +let lastRegex = /caboose$/; // Change this line +let result = lastRegex.test(caboose); +```