Groups
Capture groups in the engine are indexed, and (optionally) can be assigned a name.
The assembler provides two commands to configure capture groups:
.groupssets how many capture groups exist..groupassigns a name to a specific capture group.
Groups are one-based, i.e. the first group has index 1.
The .groups Command
Syntax
- .groups 3
Declare that the program uses three capture groups.
Notes
.groupscan only be used once.It must appear before any program code is emitted.
The maximum number of capture groups is
100.
The .group Command
Syntax
- .group 1 “name”
Assign the name
nameto capture group 1.
Arguments
indexGroup index in the range
1to the value passed to.groups."text"The group name.
Notes
.groupsmust be used before.group.Each group name can only be set once.
Any additional token after the name causes an error.
Examples
.groups 2
.group 1 "first"
.group 2 "second"