123456789101112131415161718192021222324252627282930313233343536 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace IoTIntegrationPlatform.Common
- {
- /// <summary>
- ///正则验证
- /// </summary>
- public static class RegexExtend
- {
- /// <summary>
- /// 邮箱验证
- /// </summary>
- /// <returns></returns>
- public static Regex EmailCheckReg()
- {
- return new Regex("^[A-Za-z0-9\\u4e00-\\u9fa5]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$", RegexOptions.CultureInvariant, TimeSpan.FromMilliseconds(1000));
- }
- /// <summary>
- /// 手机号验证
- /// </summary>
- /// <returns></returns>
- public static Regex PhoneCheckReg()
- {
- return new Regex("^1[3-9]\\d{9}$", RegexOptions.CultureInvariant, TimeSpan.FromMilliseconds(1000));
- }
- };
- }
|