本模块提供字符串格式验证方法。
- Source:
Methods
(static) isEmail(str) → {boolean}
检查目标字符串是否电子邮箱地址。
Parameters:
Name | Type | Description |
---|---|---|
str |
string | 目标字符串。 |
- Source:
Returns:
目标字符串是否电子邮箱地址。
- Type
- boolean
Example
isEmail('me@polyv.net'); // true
isEmail('me@polyv_.net-'); // false
(static) isPhoneNO(str) → {boolean}
检查目标字符串是否手机号码。
Parameters:
Name | Type | Description |
---|---|---|
str |
string | 目标字符串。 |
- Source:
Returns:
目标字符串是否手机号码。
- Type
- boolean
Example
isPhoneNO('13800138000'); // true
isPhoneNO('a13800138000c'); // false