mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
10 lines
213 B
Go
10 lines
213 B
Go
package validation
|
|
|
|
import (
|
|
val "github.com/go-playground/validator/v10"
|
|
"regexp"
|
|
)
|
|
|
|
func alphaNumDash(fl val.FieldLevel) bool {
|
|
return regexp.MustCompile(`^[a-zA-Z0-9-]+$`).MatchString(fl.Field().String())
|
|
}
|