Tell us what’s happening:
I’m confused. The ^
negates a character set, right?
So why does this solution call for /^(\d+)\s\1\s\1$/
? Does the carat work differently here? How??
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36
Challenge: Reuse Patterns Using Capture Groups
Link to the challenge:
Yes, when used in a character set:
[^a-z] // not a-z
Yes, it is used at the beginning of the regex so it means to anchor the regex to the beginning of the string. In other words, no other characters can come before it.
/^(\d+)
“0…” matches.
“a0…” does not match.
1 Like
I see so it has a whole another use. Thanks!
1 Like
system
Closed
August 23, 2022, 7:27am
4
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.