regmatch

package
v0.0.0-...-3b8fdc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PHONE            = `[1](([3][0-9])|([4][5-9])|([5][0-3,5-9])|([6][5,6])|([7][0-8])|([8][0-9])|([9][1,8,9]))[0-9]{8}`
	LINDLINENUMBER   = `\b(0\d{2,3}-\d{7,8}|\(?0\d{2,3}[)-]?\d{7,8}|\(?0\d{2,3}[)-]*\d{7,8})\b`
	RECORDNO         = `[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]`
	PASSPORTNUMBER   = `([a-zA-z]|[0-9]){5,17}`
	PASSPORT         = `[HMhm]{1}([0-9]{10}|[0-9]{8})`
	IPV4             = `(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(.|$)){4})`
	IPV6             = `` /* 211-byte string literal not displayed */
	MAC              = `(?:(?:(?:[a-f0-9A-F]{2}:){5})|(?:(?:[a-f0-9A-F]{2}-){5}))[a-f0-9A-F]{2}`
	EMAIL            = `([\w.\_]{2,10})@(\w{1,}).([a-z]{2,4})`
	SOCIALCREDITCODE = `[\dANY]{1}\d{7}[0-9A-HJ-NPQRTUWXY]{10}`
	URL              = `^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?`
	URLPORT          = `^((ht|f)tps?:\/\/)?[\w-]+(\.[\w-]+)+:\d{1,5}\/?$`
	AMOUNT           = `(?:^[1-9]([0-9]+)?(?:\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\.[0-9](?:[0-9])?$)`
)

Variables

This section is empty.

Functions

func CheckPasswordLever

func CheckPasswordLever(ps string) error

CheckPasswordLever 密码常用正则表达式 密码强度必须为字⺟⼤⼩写+数字+符号,9位以上

func Passport

func Passport(passport string) bool

Passport 港澳通行证

func PassportNumber

func PassportNumber(passportNumber string) bool

PassportNumber 护照编号

func RegAmount

func RegAmount(amount string) bool

RegAmount 金额(正数,可有最多两位小数,如:8.99)

func RegEmail

func RegEmail(email string) bool

RegEmail 电子邮箱地址

func RegIDCard

func RegIDCard(idCard string) bool

RegIDCard 18位身份证号

func RegIPV4

func RegIPV4(ipv4 string) bool

RegIPV4 判定数据内容是否包含IP地址

func RegIPV6

func RegIPV6(ipv6 string) bool

RegIPV6 判定数据内容是否包含IPV6地址

func RegLandLineNumber

func RegLandLineNumber(lindLineNumber string) bool

RegLandLineNumber 座机号 判定数据内容是否包含中国固定电话号码

func RegMAC

func RegMAC(mac string) bool

RegMAC 判定数据内容是否包含IP地址

func RegMatchPhone

func RegMatchPhone(phone string) bool

RegMatchPhone reg match phone

func RegSocialCreditCode

func RegSocialCreditCode(socialCreditCode string) bool

RegSocialCreditCode 统一社会信用代码

func RegUrl

func RegUrl(url string) bool

RegUrl 网址URL(不带端口号,如:https://www.baidu.com/

func RegUrlPort

func RegUrlPort(urlPort string) bool

RegUrlPort 网址URL(带端口号,如:https://www.baidu.com:8080/

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL