Regex not working

Regex not working
0

#1

This is my regex-

/h{3,6}/

Why is not working here?
Specify Upper and Lower Number of Matches


#2

You’re only matching the h’s :slight_smile:


#3

Thank you.
But, is not that the constraint?

Change the regex ohRegex to match only 3 to 6 letter h’s in the word “Oh no”.


#4

The instructions are " only 3 to 6 letter h" in the strings being tested. The last test has seven h’s and the regex will still test true but the FCC test fails as it’s expecting “false” instead. (That “only” is annoying.)


#5

I see. Thank you.
This one did it-

/Oh{3,6}\b/


#6

Glad it helped - you’re welcome.