RegexUtil class

正则表达式工具类

another Fairy

Constructors

RegexUtil()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

regexDate String
格式为“yyyy-MM-dd”的日期正则表达式
final
regexEmail String
电子邮件正则表达式
final
regexIdCard15 String
身份证号码的正则表达式,长度为15
final
regexIdCard18 String
身份证号码的正则表达式,长度为18
final
regexIp String
ip地址的正则表达式。
final
regexMobileSimple String
简单11位手机号验证
final
regexTel String
电话号码正则表达式
final
regexUrl String
url的正则表达式
final
regexZh String
汉字正则表达式
final

Static Methods

isDate(String? date) bool
是否格式为“yyyy-MM-dd”的日期
isEmail(String? email) bool
是否邮箱地址
isIDCard15(String? cardNo) bool
是否长度为15位的身份证号码
isIDCard18(String? cardNo) bool
是否长度为18位的身份证号码
isIP(String? ip) bool
是否ip地址
isMobileSimple(String? mobile) bool
是否手机号
isPassword(String? password, {String regex = regexPwd}) bool
必须包含字母和数字, 6~18
isTel(String? tel) bool
是否电话号码
isURL(String? url) bool
是否url地址
isZh(String? zh) bool
是否包含汉字
matches(String regex, String? input) bool
正则匹配

Constants

regexPwd → const String
必须包含字母和数字,不能包含特色字符, 6~18.
regexPwdAndSpecial → const String
必须包含字母和数字和特殊字符, 6~18.
regexPwdOrSpecial → const String
必须包含字母和数字,可包含特殊字符 6~18.