Documentation ¶
Index ¶
- Variables
- func HasWhitespace(str string) bool
- func IsAlphaNumeric(s string) bool
- func IsChinese(str string) bool
- func IsChineseName(str string) bool
- func IsEmail(s string) bool
- func IsEmailRFC(email string) bool
- func IsHexColor(s string) (string, bool)
- func IsRGBColor(s string) bool
- func IsURL(s string) bool
- func IsWhitespaces(str string) bool
- func IsWord(str string) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RegexEmail = regexp.MustCompile(patternEmail) RegexStrictEmail = regexp.MustCompile(patternStrictEmail) RegexURL = regexp.MustCompile(patternURL) RegexRGBColor = regexp.MustCompile(patternRGBColor) RegexHexColor = regexp.MustCompile(patternRegexHexColor) RegexAlphaNumeric = regexp.MustCompile(patternLetterNumeric) RegexChinese = regexp.MustCompile(patternChinese) RegexChineseName = regexp.MustCompile(patternChineseName) RegexWord = regexp.MustCompile(patternWord) RegexWhitespaceAll = regexp.MustCompile(patternWhitespaceAll) RegexWhitespaceHas = regexp.MustCompile(patternWhitespaceHas) )
全局预编译regex
Functions ¶
func IsEmail ¶
IsEmail validates string is an email address, if not return false basically validation can match 99% cases
func IsEmailRFC ¶
IsEmailRFC validates string is an email address, if not return false this validation omits RFC 2822
func IsHexColor ¶ added in v0.1.6
IsHexColor 检查是否十六进制颜色,并返回带"#"的修正值.
func IsRGBColor ¶ added in v0.1.6
IsRGBColor 是否是rgb颜色格式 rgb(0,31, 255)
func IsURL ¶
IsURL validates string is a url link, if not return false simple validation can match 99% cases
func IsWhitespaces ¶ added in v0.1.6
IsWhitespaces 是否全部空白字符,不包括空字符串.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.