app-starlock/lib/tools/regularExpression.dart
Daisy caf62a7413 1,新增自定义短信模版列表接口对接
2,新增获取默认短信模版接口对接及相应逻辑处理
3,新增电子钥匙、密码模版相关逻辑及布局处理
4,新增添加短信模版(电子钥匙、密码)接口对接
5,修复新建短信模版点击报错不能展示问题
2024-06-04 14:44:04 +08:00

20 lines
544 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class RegularExpression {
bool isPhoneNumber(String input) {
// 手机号正则表达式这里简化为11位数字
final RegExp phoneRegExp = RegExp(r'^\d{11}$');
return phoneRegExp.hasMatch(input);
}
bool isEmail(String input) {
// 邮箱正则表达式,这里简化为常见格式
final RegExp emailRegExp =
RegExp(r'^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$');
return emailRegExp.hasMatch(input);
}
static RegExp urlRegExp = RegExp(
r'https?:\/\/\S+',
caseSensitive: false,
);
}