code: func RegexpMatcher(name string) *starlark.Builtin {
  	cache := regexpCache{r: make(map[string]*regexp.Regexp)}
  	return starlark.NewBuiltin(name, func(_ *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {
  		var pattern, str starlark.String
  		err := starlark.UnpackArgs(name, args, kwargs,
  			"pattern", &pattern,
  			"str", &str,
  		)
  		if err != nil {
  			return nil, err
  		}
  		groups, err := cache.matches(pattern.GoString(), str.GoString())
  		if err != nil {
  			return nil, err
  		}
  		tup := make(starlark.Tuple, len(groups))
  		for i, s := range groups {
  			tup[i] = starlark.String(s)
  		}
  		return tup, nil
  	})
  }
docs: // RegexpMatcher returns a function (with given name) that allows Starlark code
  // to do regular expression matches:
  //
  //  def submatches(pattern, str):
  //    """Returns a tuple of submatches with the leftmost match of the regular
  //    expression.
  //
  //    The returned tuple has the full match as a first item, followed by
  //    subexpression matches.
  //
  //    If the string doesn't match the expression returns an empty tuple. Fails if
  //    the regular expression can't be compiled.
  //    """
  //
  // Uses Go regexp engine, which is slightly different from Python's. API also
  // explicitly does NOT try to mimic Python's 're' module.
  //
  // Each separate instance of the builtin holds a cache of compiled regular
  // expressions internally. The cache is never cleaned up. Errors are not cached,
  // since we don't expect to see them often.
  //
  // Safe for concurrent use.