regex

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

* @Author: kamalyes 501893067@qq.com * @Date: 2023-07-28 00:50:58 * @LastEditors: kamalyes 501893067@qq.com * @LastEditTime: 2024-07-30 17:26:07 * @FilePath: \go-toolbox\pkg\regex\any.go * @Description: * * Copyright (c) 2024 by kamalyes, All Rights Reserved.

* @Author: kamalyes 501893067@qq.com * @Date: 2023-07-28 00:50:58 * @LastEditors: kamalyes 501893067@qq.com * @LastEditTime: 2024-07-28 21:35:12 * @FilePath: \go-toolbox\pkg\regex\vaiable.go * @Description: * * Copyright (c) 2024 by kamalyes, All Rights Reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchEnCharacterDotUnderLine

func MatchEnCharacterDotUnderLine(str string) bool

MatchEnCharacterDotUnderLine 检查字符串是否为只包含字母、数字、点号和下划线

func RemoveSymbols

func RemoveSymbols(s string) string

RemoveSymbols 正则匹配去掉所有符号

Types

type AnyRegs

type AnyRegs struct{}

func NewAnyRegs

func NewAnyRegs() *AnyRegs

func (*AnyRegs) MatchChineseCharacter

func (g *AnyRegs) MatchChineseCharacter(str string) bool

MatchChineseCharacter 纯汉字

func (*AnyRegs) MatchChineseIDCardNumber

func (g *AnyRegs) MatchChineseIDCardNumber(id string) bool

MatchChineseIDCardNumber 验证大陆身份证号

func (*AnyRegs) MatchChinesePhoneNumber

func (g *AnyRegs) MatchChinesePhoneNumber(str string) bool

MatchChinesePhoneNumber 大陆手机号

func (*AnyRegs) MatchContainChineseCharacter

func (g *AnyRegs) MatchContainChineseCharacter(str string) bool

MatchContainChineseCharacter 大陆手机号

func (*AnyRegs) MatchDoubleByte

func (g *AnyRegs) MatchDoubleByte(input string) bool

MatchDoubleByte 匹配双字节字符(包括汉字在内)

func (*AnyRegs) MatchEmail

func (g *AnyRegs) MatchEmail(str string) bool

MatchEmail email

func (*AnyRegs) MatchEmptyLine

func (g *AnyRegs) MatchEmptyLine(input string) bool

MatchEmptyLine 匹配零个或多个空白字符(包括空格、制表符、换页符等)

func (*AnyRegs) MatchEnCharacter

func (g *AnyRegs) MatchEnCharacter(str string) bool

MatchEnCharacter 纯英文字符串,大小写不敏感

func (*AnyRegs) MatchGeNNumber

func (g *AnyRegs) MatchGeNNumber(str string, n int) bool

MatchGeNNumber 长度不小于n位的纯数字

func (*AnyRegs) MatchIPv4

func (g *AnyRegs) MatchIPv4(input string) bool

MatchIPv4 ipv4

func (*AnyRegs) MatchIPv6

func (g *AnyRegs) MatchIPv6(input string) bool

MatchIPv6 ipv6

func (*AnyRegs) MatchIntOrFloat

func (g *AnyRegs) MatchIntOrFloat(str string) bool

MatchIntOrFloat 整数或者小数

func (*AnyRegs) MatchIsContainSpecialCharacter

func (g *AnyRegs) MatchIsContainSpecialCharacter(str string) bool

MatchIsContainSpecialCharacter 验证是否包含特殊字符串

func (*AnyRegs) MatchLenNNumber

func (g *AnyRegs) MatchLenNNumber(str string, n int) bool

MatchLenNNumber 长度为n的纯数字

func (*AnyRegs) MatchLowerEnCharacter

func (g *AnyRegs) MatchLowerEnCharacter(str string) bool

MatchLowerEnCharacter 纯小写英文字符串

func (*AnyRegs) MatchMNIntervalNumber

func (g *AnyRegs) MatchMNIntervalNumber(str string, m, n int) bool

MatchMNIntervalNumber 长度m~n位的纯数字

func (*AnyRegs) MatchMNNovelsOfRealNumber

func (g *AnyRegs) MatchMNNovelsOfRealNumber(str string, m, n int) bool

MatchMNNovelsOfRealNumber m~n位小数的正实数

func (*AnyRegs) MatchNLeCharacter

func (g *AnyRegs) MatchNLeCharacter(str string, n int) bool

MatchNLeCharacter 长度为n的字符,特殊字符除外

func (*AnyRegs) MatchNNovelsOfRealNumber

func (g *AnyRegs) MatchNNovelsOfRealNumber(str string, n int) bool

MatchNNovelsOfRealNumber 有n位小数的正实数

func (*AnyRegs) MatchNanZeroNegNumber

func (g *AnyRegs) MatchNanZeroNegNumber(str string) bool

MatchNanZeroNegNumber 非零的负整数

func (*AnyRegs) MatchNanZeroNumber

func (g *AnyRegs) MatchNanZeroNumber(str string) bool

MatchNanZeroNumber 非零的正整数

func (*AnyRegs) MatchNumber

func (g *AnyRegs) MatchNumber(str string) bool

MatchNumber 纯数字

func (*AnyRegs) MatchNumberEnCharacter

func (g *AnyRegs) MatchNumberEnCharacter(str string) bool

MatchNumberEnCharacter 数字和26个英文字母组成的字符串,大小写不敏感

func (*AnyRegs) MatchNumberEnUnderscores

func (g *AnyRegs) MatchNumberEnUnderscores(str string) bool

MatchNumberEnUnderscores 数字和26个英文字母组成的字符串,大小写不敏感

func (*AnyRegs) MatchPass1

func (g *AnyRegs) MatchPass1(str string, m, n int) bool

MatchPass1 密码1 由数字、26个英文字母或者下划线组成的英文开头的字符串, 长度m~n位

func (*AnyRegs) MatchPass2

func (g *AnyRegs) MatchPass2(str string) bool

MatchPass2 密码2 密码长度至少为8个字符。 包含至少一个小写字母。 包含至少一个大写字母。 包含至少一个数字。 包含至少一个特殊字符(例如 !@#$%^&*() 等

func (*AnyRegs) MatchStartingWithNonZero

func (g *AnyRegs) MatchStartingWithNonZero(str string) bool

MatchStartingWithNonZero 非零开头的纯数字

func (*AnyRegs) MatchTime

func (g *AnyRegs) MatchTime(input string) bool

MatchTime 时间

func (*AnyRegs) MatchUpEnCharacter

func (g *AnyRegs) MatchUpEnCharacter(str string) bool

MatchUpEnCharacter 纯大写英文字符串

Jump to

Keyboard shortcuts

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