nginx-ui/internal/validation/alpha_num_dash_dot.go
2024-01-29 21:24:32 +08:00

10 lines
217 B
Go

package validation
import (
val "github.com/go-playground/validator/v10"
"regexp"
)
func alphaNumDashDot(fl val.FieldLevel) bool {
return regexp.MustCompile(`^[a-zA-Z0-9-.]+$`).MatchString(fl.Field().String())
}