regexps

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DomainPreg   = regexp.MustCompile(`^[0-9a-zA-Z]+[0-9a-zA-Z.-]*\.[a-zA-Z]{2,4}$`)
	EmailPreg    = regexp.MustCompile(`^(\w)+(\.\w+)*@(\w)+((\.\w{2,3}){1,3})$`)
	PhonePreg    = regexp.MustCompile(`^1[345789]\d{9}$`)
	UsernamePreg = regexp.MustCompile(`^[a-zA-Z][0-9a-zA-Z_]{5,29}$`)
)

Functions

func CheckDomain added in v1.0.3

func CheckDomain(domain string) bool

CheckDomain 域名检查.

func CheckEmail added in v1.0.3

func CheckEmail(email string) bool

CheckEmail 邮箱检查.

func CheckPhone added in v1.0.3

func CheckPhone(phone string) bool

CheckPhone 手机号检查.

func CheckUsername added in v1.0.3

func CheckUsername(username string) bool

CheckUsername 用户名检查.

Types

This section is empty.

Jump to

Keyboard shortcuts

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