app-starlock/lib/tools/regularExpression.dart
Daisy 63e963b3e0 1,新增公用正则判断文件
2,设置/更新授权管理员接口修改及对接
3,发送授权管理员/详情新增仅管理自己创建的用户及相关逻辑处理
4,批量授权管理员模块代码重构
5,部分模块代码风格优化
2024-05-20 17:12:34 +08:00

15 lines
453 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);
}
}