Closed
Description
- I have looked at the documentation here first?
- I have looked at the examples provided that may showcase my question here?
Enhancement:
Why dont you add a new regexp
tag like so
type Country struct {
Name string `validate:"required" regexp:"^.{1,100}$"`
Alpha2 string `validate:"required" regexp:"^[a-zA-Z]{2}$"`
Alpha3 string `validate:"required" regexp:"^[a-zA-Z]{3}$"`
Region string `regexp:"^Europe$|^Africa$|^Americas$|^Oceania$|^Asia$"`
}
I know that it won’t be possible to add support for regexp inside the validate
tag and maybe this is against the design, but regexp is also a basic tool that everyone needs.
Metadata
Metadata
Assignees
Labels
No labels