Somehow, I am able to produce the ‘right’ results according to what the instructions say to pass the tests with an external regex website. However, it didn’t pass here. I’m not sure if I am to blame or something, but I need someone to confirm if I am wrong. Down below is my regex code.
/^(\s?\d+){2}\1$/g
Also, I’m confused about using the capture group twice. How would I do this? Thank you!
// running tests
Your regex should reuse a capture group twice.
Your regex should have two spaces separating the three numbers.
Your regex should match "42 42 42".
Your regex should match "100 100 100".
Your regex should match "10 10 10".
// tests completed
here you are referencing the capture group with \1, you can use it again to reference the same group a second time
don’t use {2} instead
also don’t use g with the test method