Specify Exact Number of Matches --Help--

Specify Exact Number of Matches --Help--
0

#1

Tell us what’s happening:
I am going crazy in this challenge!!
**I tried this code:
let timStr = “Timmmmber”;
let timRegex = /ti{4}ber/; // Change this line
let result = timRegex.test(timStr); but it did’nt work :joy::joy:

Your code so far


let timStr = "Timmmmber";
let timRegex = /[^m]m{4}{?!m}/; // Change this line
let result = timRegex.test(timStr);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/specify-exact-number-of-matches


#2

How are you matching the capital T ?
How are you matching the m?


#3

You have not specified a capital T anywhere in your regular expression.


#4

What do you mean sir, hahahaha, sorry, i’m very confused


#5

If you are checking for the word Timmmmber, then using a lowercase t will not match the capital T in Timmmmber. JavaScript regular expression are case sensitive unless you use the “i” flag, but that is not needed to solve this challenge.


#6

I really don’t get it sir, sorry, my head is aching :sob::sob:


#7

Let me put it this way. If I asked you to spell your name as janzengo, that would be different than JanzenGo. In the first spelling, everything is lowercase. In the second spelling the J and the G are uppercase.


#8

Got it sirrr! Thanksss very muchh!!


#9

How do you match the word Tim ?
/Tim/ right?

How do you match the word Timm?
/Tim{2}/ would work right?

So how would you match Timmmm?
And how would you match Timmmmber?


#10

That also worked, thanks ma’am! :heart_eyes: