regex.go 315 B

12345678910111213
  1. package controller
  2. import (
  3. "errors"
  4. "regexp"
  5. )
  6. var errInvalidExtClientID = errors.New("ext client ID must be alphanumderic and/or dashes")
  7. // allow only dashes and alphaneumeric for ext client and node names
  8. func validName(name string) bool {
  9. return regexp.MustCompile("^[a-zA-Z0-9-]+$").MatchString(name)
  10. }