I am currently working on Regex Challenges on Hackerrank and can't find resources on to why using capture group references are preferred over repetitions. Here is the link to the Challenge: https://www.hackerrank.com/contests/chingu-challenge-8-regex/challenges/matching-same-text-again-again/problem
Why is the first option of the following two preferred over the second? (Meaning what is the difference?! The second one gives me a mistake on the challenge)
1.Ref. Capture Group: ^([a-z]\w\s\W\d\D[A-Z][A-Za-z][aeiouAEIOU]\S)\1$
2.Repetition: ^([a-z]\w\s\W\d\D[A-Z][A-Za-z][aeiouAEIOU]\S){2}$
Thanks in advance.