package
Version:
v0.5.1
Opens a new window with list of versions in this module.
Published: Dec 13, 2025
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
IsEmail 判断字符串是否为合法的邮箱格式(简单校验)。
输入: 任意字符串
输出: true 表示看起来像邮箱,false 表示不是
注意: 此函数做轻量级格式校验,不连接网络或验证域名存在性。
IsIDCard 判断中国身份证号(15 位或 18 位)的基本合法性。
对 18 位身份证会校验最后一位校验码;15 位仅做纯数字长度校验。
IsIPv4 判断字符串是否为合法的 IPv4 地址(点分十进制,0.0.0.0 - 255.255.255.255)。
IsMobile 判断字符串是否为中国大陆手机号(支持可选的 +86 前缀)。
规则:可带 "+86" 或 "86" 前缀,主号码为 1 开头且第二位为 3-9 的 11 位数字。
IsNumeric 判断字符串是否为整数或小数(可带负号)。
IsPort 判断字符串是否为合法端口(0-65535)。
IsURL 简单判断是否为合法 URL(要求包含 scheme 和 host)。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.