code: func StringMatch(r *regexp.Regexp, message string) schema.SchemaValidateFunc {
  	return func(i interface{}, k string) ([]string, []error) {
  		v, ok := i.(string)
  		if !ok {
  			return nil, []error{fmt.Errorf("expected type of %s to be string", k)}
  		}
  
  		if ok := r.MatchString(v); !ok {
  			if message != "" {
  				return nil, []error{fmt.Errorf("invalid value for %s (%s)", k, message)}
  
  			}
  			return nil, []error{fmt.Errorf("expected value of %s to match regular expression %q", k, r)}
  		}
  		return nil, nil
  	}
  }
docs: // StringMatch returns a SchemaValidateFunc which tests if the provided value
  // matches a given regexp. Optionally an error message can be provided to
  // return something friendlier than "must match some globby regexp".