Regular Expressions - Specify Upper and Lower Number of Matches

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

let ohStr = "Ohhh no";
let ohRegex = /change/; // 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/118.0.0.0 YaBrowser/23.11.0.0 Safari/537.36

Challenge Information:

Regular Expressions - Specify Upper and Lower Number of Matches
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/regular-expressions/specify-upper-and-lower-number-of-matches`let ohStr = “Ohhh no”;
let ohRegex = /oh{3,6}\sno/i; // Change this line
let result = ohRegex.test(ohStr);`
There is nothing incomprehensible here, why indicate in the standard form, but why not just o? why specify such a sn entry? why not only with?

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

the more complex the regex, the more specific it is
/oh{3,6}/ will match strings such as “Ohhh yes”, but the regex in this case should match only “Ohhhh no” strings, so the regex is like that

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.