func (r *Regexp) Indices() []int {
	return r.indices
}
Indices returns the indices of the outermost capturing groups found in
the regexp.

Not all indices may be present because nested capturing groups are ignored.
package reverse
import (
	"bytes"
	"fmt"
	"net/url"
	"regexp"
	"regexp/syntax"
)
type Regexp struct {
	compiled *regexp.Regexp  
	template string          
	groups   []string        
	indices []int  
}
func CompileRegexp(pattern string) (*Regexp, error) {
	compiled, err := regexp.Compile(pattern)
	if err != nil {
		return nil, err
	}
	re, err := syntax.Parse(pattern, syntax.Perl)
	if err != nil {
		return nil, err
	}
	tpl := &template{buffer: new(bytes.Buffer)}
	tpl.write(re)
	return &Regexp{
		compiled: compiled,
		template: tpl.buffer.String(),
		groups:   tpl.groups,
		indices:  tpl.indices,
	}, nil
}
func (r *Regexp) Compiled() *regexp.Regexp {
	return r.compiled
}
func (r *Regexp) Template() string {
	return r.template
}
func (r *Regexp) Groups() []string {
	return r.groups
}