Backreferences in Java Regular Expressions is another important feature provided by Java.
To understand backreferences, we need to understand group first. Group in regular expression means treating multiple characters as a single unit. They are created by placing the characters to be grouped inside a set of parentheses – â€()â€. Each set of parentheses corresponds to a group.