Reuse Patterns Using Capture Groups / help

Tell us what’s happening:
I am still failing the following challenge
Your regex should not match "42 42 42 42"
I do not know why
Does anyone have an idea?

Your code so far


let repeatNum = "42 42 42";
let reRegex = /(\d{2,})\s\1\s\1/; // Change this line
let result = reRegex.test(repeatNum);
repeatNum.match(reRegex);

Your browser information:

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

Challenge: Reuse Patterns Using Capture Groups

Link to the challenge:

Your regex is incorrectly matching it. Similarly it would happen i.e. for 42 42 42 42 42. Think about this challenge in a way that you need to match string having group exactly three times, not less, not more and nothing else.

I still do not have any idea
Your explanation sounds like \b(\d+\s\d+\s\d+)\s\1\s\1 but this is also wrong

Take another look at your first regex. In string 42 42 42 42 you are getting match because regex matches the first three numbers in it
42 42 42 42
You can actually add anything you want and regex would still match. i.e.
42 42 42 123456789

Meanwhile it need to match only case where in string there are only three numbers.

Thanks man. Code long and prosper :slightly_smiling_face: