diff options
Diffstat (limited to 'src/pkg/regexp/regexp.go')
-rw-r--r-- | src/pkg/regexp/regexp.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pkg/regexp/regexp.go b/src/pkg/regexp/regexp.go index fd6fbefee..373d6b1af 100644 --- a/src/pkg/regexp/regexp.go +++ b/src/pkg/regexp/regexp.go @@ -677,6 +677,9 @@ func MustCompile(str string) *Regexp { return regexp } +// NumSubexp returns the number of parenthesized subexpressions in this Regexp. +func (re *Regexp) NumSubexp() int { return re.nbra } + // The match arena allows us to reduce the garbage generated by tossing // match vectors away as we execute. Matches are ref counted and returned // to a free list when no longer active. Increases a simple benchmark by 22X. |