code: func createRepeatingGenerator(regexp *syntax.Regexp, genArgs *GeneratorArgs, min, max int) (*internalGenerator, error) {
  	if err := enforceSingleSub(regexp); err != nil {
  		return nil, err
  	}
  
  	generator, err := newGenerator(regexp.Sub[0], genArgs)
  	if err != nil {
  		return nil, generatorError(err, "failed to create generator for subexpression: /%s/", regexp)
  	}
  
  	if min == noBound {
  		min = int(genArgs.MinUnboundedRepeatCount)
  	}
  	if max == noBound {
  		max = int(genArgs.MaxUnboundedRepeatCount)
  	}
  
  	return &internalGenerator{regexp.String(), func() string {
  		n := min + genArgs.rng.Intn(max-min+1)
  
  		var result bytes.Buffer
  		for i := 0; i < n; i++ {
  			result.WriteString(generator.Generate())
  		}
  		return result.String()
  	}}, nil
  }
docs: // Returns a generator that will run the generator for r's sub-expression [min, max] times.