I am trying to simplify this solution and I still do not understand why, even after removing spaces I need to define the limits through ^ and $ if repeatNum contain all the groups, and not any extra string, that I want to include in reRegex.
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; rv:93.0) Gecko/20100101 Firefox/93.0
Challenge: Reuse Patterns Using Capture Groups
Link to the challenge: