Files
Adaptix-Framework-AdaptixC2/AdaptixServer/core/utils/valid/valid.go
T
2025-01-22 15:56:04 +03:00

24 lines
504 B
Go

package isvalid
import "regexp"
func ValidListenerName(s string) bool {
re := regexp.MustCompile("^[a-zA-Z0-9-_]+$")
return re.MatchString(s)
}
func ValidUriString(s string) bool {
re := regexp.MustCompile(`^/(?:[a-zA-Z0-9-_]+(?:/[a-zA-Z0-9-_]+)*)?$`)
return re.MatchString(s)
}
func ValidSBString(s string) bool {
re := regexp.MustCompile(`^[a-zA-Z]+$`)
return re.MatchString(s)
}
func ValidSBNString(s string) bool {
re := regexp.MustCompile(`^[a-zA-Z0-9-_]+$`)
return re.MatchString(s)
}