Groups group multiple patterns as a whole, and capturing groups provide extra submatch information when using a regular expression pattern to match against a string. Backreferences refer to a previously captured group in the same regular expression. Try itTypesExamplesUsing groups
Using named groups
Using groups and back references
Using groups and match indicesBy providing the
See also |