let repeatNum = "4212 4212 4212";
let reRegex = /^(\d+)(\s\1)\2$/; // Change this line
let result = reRegex.test(repeatNum);
let res2 = repeatNum.match(reRegex);
console.log(result);
console.log(res2);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36.
Your regex returns the correct values for all of the test strings, but does not meet the Your regex should have two spaces separating the three numbers. test.
Think about what capture groups are. (\d+) is a capture group. (\d+)(\d+) is two capture groups.
What if you wanted a space between your capture groups?