A group in a regular expression serves a number of different possible purposes:
- To denote repetition (of more than a single character)
- To restrict alternation to a part of the regular expression
- To capture a value
A group in a regular expression serves a number of different possible purposes: