You already learned about groups.
I like (apples|bananas) matches “I like apples” and “I like bananas”
(ha)+ matches “haha” and “hahahaha”
But what if you want to match the same group again?
That’s where group references come in.
You can use \1, \2, \3, etc. to refer to the first, second, third, etc. group in the regex.
For example:
(Finn|Kai) is the same Person as \1
The reference will only match the same text as the group it refers to.
So Finn is the same Person as Kai will not match
Match Apples & Apples and Bananas & Bananas