Specify Upper and Lower Number of Matches - why does the solution fail one test when the "O" is removed from the "ohRegex" regex?

Tell us what’s happening:
I was able to understand the lesson and complete the exercise, but I why does the solution fail one test when the “O” is removed from the “ohRegex” regex?

Your code so far


let ohStr = "Ohhh no";
let ohRegex = /^Oh{3,6}\s/; // Change this line
let result = ohRegex.test(ohStr);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36.

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

Which test are you talking about? If you remove the “O” from the regex, it correctly fails 4 tests.

It fails (I think) because the ^ marks the start of the string, and if you remove the O then it thinks the start is the letter h, which it isn’t so it marks it as a fail right from the start.

I’m having slight issues with mastering the regexs but I had the let ohRegex = /h{3,6}\s/ and it failed only the last case with Ohhhhhhh no. It can get a bit confusing to get the right answer, but that is more of a sign of my own literal understanding of the assignment than it is hard.