**Tell us what's happening:**
Hello guys I have been bugged down with trying to create a regular expression for a seemingly little phrase`
**Your code so far**
`let repeatNum = "42 42 42";
let reRegex = /(\d+)(\s)\1\2/g; // Change this line
let result = reRegex.test(repeatNum);
console.log(repeatNum.match(reRegex));
**Challenge:** Reuse Patterns Using Capture Groups
**Link to the challenge:**
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups
So, in your regex:
let reRegex = /(\d+)(\s)\1\2/g;
You have two capture groups, yes. \1
would refer to the (\d+)
value, and \2
refers to the (\s)
. Which is great, except that you’re now looking for a number, followed by a space, followed by the same number, followed by a space… is something missing?