Files
mstore/pkg/repocli/uuid.go
T
2026-03-11 19:47:40 +02:00

23 lines
545 B
Go

/*
* Copyright 2026 Oleg Borodin <onborodin@gmail.com>
*
* This work is published and licensed under a Creative Commons
* Attribution-NonCommercial-NoDerivatives 4.0 International License.
*
* Distribution of this work is permitted, but commercial use and
* modifications are strictly prohibited.
*/
package repocli
import (
"regexp"
)
const uuidRegex = `^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`
func isUUID(src string) bool {
re := regexp.MustCompile(uuidRegex)
return re.MatchString(src)
}