Grouping Constructs
The following regular expression grouping constructs let you extract a subset of information from a token or text.
Regular Expression | Description |
---|---|
(expr) | Match or capture group. Captures the information that matches the expression in parentheses |
(?:expr) | Non-capturing group. Groups the contained expressions together (e.g., to apply a quantifier to multiple symbols at once), but does not restrict the information to be captured to only that group. |
(?=expr) | Captures information that is followed by the expression if the expression is true and the input matches the pattern that follows this expression. |
(?<>) | Named capture group.* |
\k<> | Named back reference. * |