...

/

Working with Backreferences

Working with Backreferences

Learn how to use back references for processing inputs having more than one match.

Backreferences

Backreferences allow us to reuse previously matched sub-strings within a regular expression pattern. A backreference matches the same sub-string that a capture group already matches.

Using \\n for backreferencing

To create a backreference, we use the following syntax:

 ...