I thought ^ was a negation operator. Why is $ put at the end?
^ is only the negation operator when it is at the start of a capturing group, like this:
^ matches the start of a string.
$ matches the end of a string.
You bring up a good point – regular expression syntax can be quite unclear because each character’s meaning depends on it’s context.
You’re missing the second \s and the \2 is not needed.
let reRegex = /^(\d+)\s\1\s\1$/;