Added function to return the number of subexpressions in the group
This commit is contained in:
@@ -18,6 +18,12 @@ type Reg struct {
|
|||||||
numGroups int
|
numGroups int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// numSubexp eturns the number of sub-expressions in the given [Reg]. This is equivalent
|
||||||
|
// to the number of capturing groups.
|
||||||
|
func (r Reg) NumSubexp() int {
|
||||||
|
return r.numGroups
|
||||||
|
}
|
||||||
|
|
||||||
const concatRune rune = 0xF0001
|
const concatRune rune = 0xF0001
|
||||||
|
|
||||||
// Flags for shuntingYard - control its behavior
|
// Flags for shuntingYard - control its behavior
|
||||||
|
Reference in New Issue
Block a user