mverify

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmail

func IsEmail(s string) bool

IsEmail 判断字符串是否为合法的邮箱格式(简单校验)。 输入: 任意字符串 输出: true 表示看起来像邮箱,false 表示不是 注意: 此函数做轻量级格式校验,不连接网络或验证域名存在性。

func IsIDCard

func IsIDCard(s string) bool

IsIDCard 判断中国身份证号(15 位或 18 位)的基本合法性。 对 18 位身份证会校验最后一位校验码;15 位仅做纯数字长度校验。

func IsIPv4

func IsIPv4(s string) bool

IsIPv4 判断字符串是否为合法的 IPv4 地址(点分十进制,0.0.0.0 - 255.255.255.255)。

func IsMobile

func IsMobile(s string) bool

IsMobile 判断字符串是否为中国大陆手机号(支持可选的 +86 前缀)。 规则:可带 "+86" 或 "86" 前缀,主号码为 1 开头且第二位为 3-9 的 11 位数字。

func IsNumeric

func IsNumeric(s string) bool

IsNumeric 判断字符串是否为整数或小数(可带负号)。

func IsPort

func IsPort(s string) bool

IsPort 判断字符串是否为合法端口(0-65535)。

func IsURL

func IsURL(s string) bool

IsURL 简单判断是否为合法 URL(要求包含 scheme 和 host)。

Types

This section is empty.

Jump to

Keyboard shortcuts

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