Hi Campers,
I’m rattling through Regular expressions, but can’t quite work out why I’m failing the final test here:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/specify-upper-and-lower-number-of-matches
My code so far:
let ohStr = "Ohhh no";
let ohRegex = /h{3,6}/; // Change this line
let result = ohRegex.test(ohStr);
Any pointers most welcome.
Thanks in advance.
Gerald
1 Like
You are matching on h
s, but the instructions want you to be dealing specifically with the words “Oh no” with 3-6 h
s.
1 Like
Penny’s dropped! Many thx.
dhahn1
August 10, 2018, 5:36pm
4
I’m actually still confused…
1 Like
You specifically need a regex for “Oh no” with three to six h
s. If all that is in your regex pattern is h{3, 6}
then you will match any three to six h
s.