arimelody-web/service/validator/validator.go

9 lines
165 B
Go
Raw Normal View History

package validator
import "regexp"
var idRegexp = regexp.MustCompile(`^[a-zA-Z0-9\-_\.]+$`)
func ValidateID(id string) bool {
return idRegexp.MatchString(id)
}