Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ChineseRegRuler string = "^[\u4e00-\u9fa5]+$"
中文正则表达式
View Source
var EmailRegRuler string = `^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$`
邮箱正则表达式
View Source
var EnglishRegRuler string = `^[a-zA-Z0-9_\-]+$`
中文正则表达式
View Source
var IDCardRegRuler string = `^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$`
身份证正则表达式
View Source
var MobileRegRuler string = `^1[3456789]{1}\d{9}$`
手机号正则表达式
View Source
var Validators = map[string]ValidatorFunc{}
Functions ¶
func InitValidators ¶
func InitValidators()
func RegisterValidators ¶
func RegisterValidators(v map[string]ValidatorFunc)
Types ¶
type ValidatorFunc ¶
type ValidatorFunc validator.Func
Click to show internal directories.
Click to hide internal directories.