]> Cypherpunks repositories - gostls13.git/commit
regexp: add (*Regexp).SubexpIndex
authorSylvain Zimmer <sylvain@sylvainzimmer.com>
Mon, 29 Jul 2019 01:15:36 +0000 (03:15 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 10 Apr 2020 09:38:07 +0000 (09:38 +0000)
commit782fcb44b96753e6e763be91a72bcbfc3dff7ab9
treec02f54f631c39d6c95ea2b7133aa9db84818543e
parent245409ea86f20fd9f4167223c2339fb238f9e4b6
regexp: add (*Regexp).SubexpIndex

SubexpIndex returns the index of the first subexpression with the given name,
or -1 if there is no subexpression with that name.

Fixes #32420

Change-Id: Ie1f9d22d50fb84e18added80a9d9a9f6dca8ffc4
Reviewed-on: https://go-review.googlesource.com/c/go/+/187919
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
src/regexp/all_test.go
src/regexp/example_test.go
src/regexp/regexp.go