Tell us what’s happening:
Describe your issue in detail here.
Location: JavaScript Algorithms and Data Structures → Regular Expressions → Specify Upper and Lower Number of Matches
My solution works (satisfy all existing requirements given), but program rejected my solution. In “Hint” I saw that program expect that regexp have to count specificaly on given string. My solution works for all strings (and for given, also), but (it seems) there is previously minded condition that is not written in list of requirements.
(this is not question; rather it is suggestion for author to correct test - there were some other similar situations, but I didn’t remind those)
Your code so far
let ohStr = "Ohhhhh no";
// my solution - works for all possible strings:
let ohRegex = /[^h]h{3,6}[^h]/; // Change this line
// Hint says: let ohRegex = /Oh{3,6}\sno/;
let result = ohRegex.test(ohStr);
console.log(result);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; rv:90.0) Gecko/20100101 Firefox/90.0
Challenge: Specify Upper and Lower Number of Matches
Link to the challenge: