/src/gitlab.com/mahina/platform/util/validator.go
https://gitlab.com/mahina/platform · Go · 12 lines · 7 code · 4 blank · 1 comment · 0 complexity · 4151f70a239cb64d0c127460afaeb1e2 MD5 · raw file
- package util
- import "regexp"
- const uuidExpr string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
- var rxUUID = regexp.MustCompile(uuidExpr)
- // IsUUID determines the validity of the passed UUID
- func IsUUID(value string) bool {
- return rxUUID.MatchString(value)
- }