Problem with the Hint 2 (Positive and Negative Lookahead)

Hello!

The problem is related to the Hint 2 (freeCodeCamp Challenge Guide: Positive and Negative Lookahead) of the challenge " Positive and Negative Lookahead" (https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/regular-expressions/positive-and-negative-lookahead)

The Hint 2 finishes with “Remember to specify the exact amount of numbers you want to appear at the end of the string.”

But the checklist in the challenge says that “Your regex should match the string astr1on11aut”.

I’m novice, so I might be wrong, but I think that it should be like “Remember to specify the exact amount of numbers you want to appear consecutively on the string.”

Anyway, if I’m wrong, I’m sorry and, if it’s possible, explain me why it is right.

Kind regards!
Marcos.

1 Like

Hi Marcos,

Remember this paragraph from the first lesson or challenge in the Regular Expressions course (https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/regular-expressions/using-the-test-method)?

I quote it below:

" If you want to find the word the in the string The dog chased the cat , you could use the following regular expression: /the/ . Notice that quote marks are not required within the regular expression. "

With that understanding, I think the statement you referenced from Hint 2 is talking about the string that you put in myRegex.

So this is what I think it meant to communicate : Remember to specify the exact amount of numbers you want to appear at the end of the regex string.

I think thus that your concern is legitimate.

Best regards.

1 Like

Thanks!
That makes more sense now!
Thank you so much!! =D

1 Like

Welcome Marcos. I’m glad.

1 Like