Skip to content

Latest commit

Β 

History

History
10 lines (7 loc) Β· 419 Bytes

groups.mdx

File metadata and controls

10 lines (7 loc) Β· 419 Bytes

Groups

Groups, as the name suggests, are meant to be used to "group" components of regular expressions. These groups can be used to:

  • Extract subsets of matches
  • Enhance readability
  • Repeat groups an arbitrary number of times
  • Make the group optional

We'll see how to do a lot of this in later chapters, but learning how groups work will allow us to study some great examples in these later chapters.