Only curiosity on regular expressions Answer whenever you can can

Tell us what’s happening:
I want to now if is there a way to avoid the “ha” and “ah” from the regular expression bellow, cause I don’t reallly know how to apply this method of specifing the lower number of matches in another situation. An example of this RegExp in another situation would be awesome thanks.

Your code so far


let haStr = "Hazzzzah";
let haRegex = /ha(z{4,}ah)/i; // Change this line
let result = haRegex.test(haStr);
console.log(result)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36.

Challenge: Specify Only the Lower Number of Matches

Link to the challenge:

1 Like

I don’t fully understand your question.

Are you just trying to get the "z"s?

BTW, the challenge you linked is confusing:

Doesn’t even make sense. It will never “match” Hazzah if it has 4 zzzs, unless you place the zs in front and back of string, which I’m sure this challenge is not asking for.

if you think the challenge is confusing please open an issue on github for a discussion on how to fix the challenge