Tell us what’s happening:
Describe your issue in detail here.
Hi,
I haven’t been working with regex for long. Even though I know that the ^...$
are used to show beginning and an end, I was wondering why we need to put them here in this context and how would the code execute without them?
Thanks
Your code so far
let repeatNum = "42 42 42";
let reRegex = /^(\d+)(\s)\1\2\1$/; // Change this line
let result = reRegex.test(repeatNum);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
.
Challenge: Reuse Patterns Using Capture Groups
Link to the challenge: