Hi,
Please explain why my code is wrong:
let repeatNum = “42 42 42”;
let reRegex = /(\d+) \1 \1/g; // Change this line
let result = reRegex.test(repeatNum);
let result2 = repeatNum.match(reRegex);
console.log(result);
console.log(result2);
Thanks
Sara
Your code so far
let repeatNum = "42 42 42";
let reRegex = /(\d+) \1 \1/g; // Change this line
let result = reRegex.test(repeatNum);
let result2 = repeatNum.match(reRegex);
console.log(result);
console.log(result2);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Challenge: Regular Expressions - Reuse Patterns Using Capture Groups