Introduction
Capturing groups let you save parts of a text that match a pattern. Backreferences let you use those saved parts again in the same pattern.
When you want to find repeated words in a sentence.
When you need to extract parts of a date like day, month, and year.
When you want to check if a string has matching pairs of characters.
When you want to replace repeated patterns with something else.