`

常用正则表达式

    博客分类:
  • .net
阅读更多
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EETOP.AbleAPI.Common
{
    /// <summary>
    /// 常用正则表达式
    /// </summary>
    public class CommonRegex
    {
        public const string email = "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$";
        public const string mobile = "^(\\+86)?1[3458][0-9]{9}$";
        public const string loginname = "\\d";
        public const string loginnameFormat = "^[_a-zA-Z0-9][a-zA-Z0-9_&-]{5,15}$";
        public const string postcode = "^\\d{6}$";
        public const string sourceFormat = "^[0-9a-zA-Z_\\.]{1,15}$";
        public const string enckeyFormat = "^[0-9a-zA-Z]{32}$";
        //public const string telphone = "(\\(\\d{3,4}\\)|\\d{3,4}-|\\d{3,4})?\\d{7,8}$"; 
        public const string loginPhone = "1[3458][0-9]{9}$";
    }
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics