Groups and Capturing
Regex Fundamentals - Lesson 6
20 min
Progress0/5
Understanding Groups
Concept
Parentheses create groups that allow you to treat multiple characters as a single unit. Groups can be quantified, alternated, or captured.
Example
(abc)+ matches "abc", "abcabc", "abcabcabc", etc. (red|blue) matches either "red" or "blue"
Practical Application
Groups let you apply operations to entire sequences, not just single characters