Reuse Patterns Using Capture Groups1[solved]

Reuse Patterns Using Capture Groups1[solved]
0

#1

Tell us what’s happening:
Where is the wrong?.

Your code so far



let repeatNum = "42 42 42";
let reRegex = /(\d+)\s\1\s\1/; // Change this line
let result = reRegex.test(repeatNum);

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups


#2

Your regex matches “42 42 42 42”. You need to find a way to exclude any extra characters.


#4

I solved it.But thank you[