Specify Upper and Lower Number of Matches: ¿inaccurate instruction?

Tell us what’s happening:

The challenge is:
'Change the regex ohRegex to match ONLY 3 to 6 letter h ‘s in the word "Oh no" .’
But, if the answer is what was indicated in the Hint button, it shouldn’t something like this?
Change the regex ohRegex to match 3 to 6 letter h 's AND/including the word "Oh no" .

Your code so far

//This was my solution 
let ohStr = "Ohhh no";
let ohRegex = /h{3,6}\s/; // Change this line
let result = ohStr.match(ohRegex)
console.log(result)//-->hhh

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.119.

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

the challenge is using test method so it is a yes/no answer, returning true or false for the tested strings. it may be a bit more accurate, but as only variations of Oh no are tested, or doesn’t actually matter

if there was a "Shouldn’t match Ahhh" test case, then it would have made a difference
if you want to suggest such a thing you can open an issue on the github repository

1 Like