Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
karan BadhwarWeb Development Techdegree Graduate 18,135 Points
Why is this working, if I put abcDefg, the tool tip is still there, but as per the code I understood, while writing abcD 'D' was once at the end, but then we overwrite it with efg why the tool tip is still there?
Rohald van MerodeTreehouse Staff
Hi karan karan,
That happens because of the
$ at the end of your RegEx. This indicates that the string has to finish with the part in front of it. Which is in this case is lowercased letters. Since you're using both the
$ here and there's nothing else in between other than the lowercased letters it will only pass when the string both starts and ends with lowercased letters.
Hope this helps 🙂