Tell us what’s happening:
why is this wrong?
Your code so far
let ohStr = "Ohhh no";
let ohRegex = /h{3,6}h{^7,}/; // Change this line
let result = ohRegex.test(ohStr);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.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
ILM
August 26, 2019, 6:08pm
2
Harshlebrown:
h{^7,}
only numbers are allowed inside the graph parenthesis
plus, you need to specify “between 3 and 6”, if you make this with correct syntax you get “between 3 and 6 h followed by 7 h” which makes it a bit too many letters than what it should be allowed
h{^7,}
wont this signify i don’t want repetitions more than 7?
ILM
August 28, 2019, 3:29pm
4
no, when use the quantifiers like that the syntax is {lowerLimit, higherLimit}
try using regex101.com , it is a tool to test your regular expression