Documentation ¶
Index ¶
Constants ¶
View Source
const ( //RegularUserName 用户名 RegularUserName = "^\\w{5,20}$" //RegularPassword 密码 RegularPassword = "^\\.{5,32}$" //RegularIpAddress IP地址 RegularIpAddress = "^([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}$" //RegularIpAddressPort IP:port RegularIpAddressPort = "^([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\:([1-6]|)\\d{0,4}$" //RegularIpAddressPortOrNot IP:port 或 IP RegularIpAddressPortOrNot = "^([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}((\\:([1-6]|)\\d{0,4})|)$" )
#正则表达式返回,防止重复造轮子#
Variables ¶
View Source
var Validate = validator.New()
Validate 创建校验器
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.