* fix: restructure certifications guide articles * fix: added 3 dashes line before prob expl * fix: added 3 dashes line before hints * fix: added 3 dashes line before solutions
650 B
650 B
title
title |
---|
Match Ending String Patterns |
Match Ending String Patterns
Problem Explanation
To finish this challenge, it's necessary to use boundaries.
The $ Matches end of input.
For example, /t$/ does not match the "t" in "eater", but does match it in "eat".
important: If the multiline flag is set to true, also matches immediately before a line break character.
Solutions
Solution 1 (Click to Show/Hide)
let caboose = "The last car on a train is the caboose";
let lastRegex = /caboose$/; // Change this line
let result = lastRegex.test(caboose);