Regular Expressions - Reuse Patterns Using Capture Groups

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

let repeatNum = "42 42 42";
let reRegex = /(\d+) \1 \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/104.0.0.0 Safari/537.36

Challenge: Regular Expressions - Reuse Patterns Using Capture Groups

Link to the challenge:

If you try your regular expression on this website https://regex101.com/ and use the failing test case you will get a good idea of why its failing. You can be more specific about where things need to match.

1 Like