Regex.getMaxBackref

int getMaxBackref()

Returns the number of the highest back reference in the pattern, or 0 if the pattern does not contain back references.

Returns

the number of the highest back reference