regexputil

package
v0.0.0-...-4675295 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const MatchBankCard = `^[a-zA-Z0-9]{16,50}$`

银行卡

View Source
const MatchContent = `^[!@#$%^&*\(\)_+~\{\}\[\]\<\>\,\.\?\/a-zA-Z0-9\p{Han}]+$`

匹配内容

View Source
const MatchEmail = `\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*`

MatchEmail source = "132@12.comGKGk15@163.cn200806084S11233240697hdgsfhah假发发货" pattern = `\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*` //匹配电子邮箱

View Source
const MatchIP = `^$(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$`

MatchIP 匹配IP地址1 `^$(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$`

View Source
const MatchIP2 = `((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)`

MatchIP2 匹配IP地址2 pattern = `((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)`

View Source
const MatchName = `^[_a-zA-Z0-9\p{Han}]*$`

MatchName source = "xx435,./$%(*(_&jgshgs发个^$%ffG返回福hjh放假啊啥UTEYgjk52RYPHFY37yy6346ferg6987sfasfxyfa" pattern = `[\p{Han}]+` //匹配连续的汉字 匹配用户昵称 ^[\u4e00-\u9fa5]{4,8}$

View Source
const MatchPhone = `1[3|5|7|8|][\d]{9}`

MatchPhone source = "13244820821HG74892109977HJA15200806084S11233240697hdgsfhah假发发货" pattern = `1[3|5|7|8|][\d]{9}` //匹配电话号码

View Source
const MatchPwd = `^[\x21-\x7E]{6,64}$`

MatchPwd 同上 const MatchPwd = `^[a-zA-Z0-9_-]{6,16}$` asc码 可视字符

View Source
const MatchTel = `^0\d{2,3}-?\d{7,8}$`

固定电话号码验证

View Source
const MatchURL = `[a-zA-Z]+://[^\s]*`

MatchURL 匹配URL `[a-zA-z]+://[^\s]*`

View Source
const MatchUrlShort = `^[^\s]+$`

MatchUrlShort 匹配短的URL

View Source
const MatchUser = `^[a-zA-Z0-9_-]{6,16}$`

MatchUser 匹配用户名或者密码 `^[a-zA-Z0-9_-]{6,16}$` 字母或者数字开头,区分大小写,最短6位最长16位

View Source
const MatchWOCode = `^[a-zA-Z0-9_-]+$`

MatchWOCode 匹配WO_CODE,

View Source
const MatchZIPCode = `[1-9][\d]5`

MatchZIPCode 匹配邮编 `[1-9][\d]5`

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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