The regular season, checking that the string consists of pairs of identical letters(may vary in case)

That is, for example, the line: AaBb correct, and strings: AaBbc AaBv and no.
As I understand here it is necessary to use a backref, but as it turns out nonsense, and not what you need
October 3rd 19 at 03:23
3 answers
October 3rd 19 at 03:25
Solution
I got the following regular season:
((\w)\2)*

If it has the flag 'Case insensitive'. Can test the regular expression on regexpal.com, debuggex.com or Regular Expression Tester
Can you tell us more about \2? - nico.Hodkiewicz0 commented on October 3rd 19 at 03:28
\n Matches what the nth marked subexpression matched, where n is a digit from 1 to 9. This construct is vaguely defined in the POSIX.2 standard. Some tools allow referencing more than nine capturing groups. - rosemarie.Okuneva commented on October 3rd 19 at 03:31
October 3rd 19 at 03:27
^(?:(\w)\1)+$
October 3rd 19 at 03:29
Thank you!

Find more questions by tags Regular expressions