/// <summary>
    ///表单 数据验证  正则表达式  
    /// </summary>
    public partial class RuleConst
    {
        ///// <summary>
        ///// 必填 
        ///// </summary>
        //public const string Required = "";

        /// <summary>
        /// 远程唯一验证 
        /// </summary>
        public const string Remote = "";

        /// <summary>
        /// url 
        /// </summary>
        public const string Url = "^(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]$";

        /// <summary>
        /// 日期 + 时间格式
        /// </summary>
        public const string Date = "^(?:19|20)[0-9][0-9]-(?:(?:0?[1-9])|(?:1[0-2]))-(?:(?:[0-2]?[1-9])|(?:[1-3][0-1]))(( |T)(?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9])?$";

        /// <summary>
        /// 数值   配合  
        /// </summary>
        public const string Number = @"^[0-9]+\\.{0,1}[0-9]{0,2}$";

        /// <summary>
        /// 数值   配合  
        /// </summary>
        public const string Digits = "^[0-9]*$";

        /// <summary>
        /// 邮箱  
        /// </summary>
        public const string Email = @"^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";

        /// <summary>
        /// 身份证号 
        /// </summary>
        public const string IDCard = @"^(\\d{6})(\\d{4})(\\d{2})(\\d{2})(\\d{3})([0-9]|X)$";

        #region 信用卡号
        /// <summary>
        /// 信用卡号
        /// </summary>
        public const string Creditcard = @"^(?:3[47][0-9]{13})|(?:3(?:0[0-5]|[68][0-9])[0-9]{11})|(?:6(?:011|5[0-9]{2})(?:[0-9]{12}))|(?:(?:2131|1800|35\\\\d{3})\\\\d{11})|((?:5[0678]\\\\d\\\\d|6304|6390|67\\\\d\\\\d)\\\\d{8,15})|((?:4[0-9]{12})(?:[0-9]{3})?)$";

        #endregion
        /// <summary>
        /// 手机号
        /// </summary>
        public const string Mobile = @"^1(3|4|5|7|8)\\d{9}$";

        /// <summary>
        /// 座机
        /// </summary>
        public const string Phone = @"^(\\(\\d{3,4}-)|\\d{3.4}-)?\\d{7,8}$";

        /// <summary>
        ///必须是字母
        /// </summary>
        public const string LettersOnly = "^[A-Za-z]+$";

        /// <summary>
        ///字母、数字、下划线
        /// </summary>
        public const string AlphaNumeric = @"^\\w+$";

        /// <summary>
        ///小写字母、数字、下划线 横杆
        /// </summary>
        public const string AlphaNumericH = @"^[a-b]([a-b]|[0-9]|-|_)+$";

        /// <summary>
        ///请输入拥有合法【后缀名】的字符串
        /// </summary>
        public const string AcceptSuffix = "^.+{0}$";

        /// <summary>
        ///请输入拥有合法【前缀名】的字符串
        /// </summary>
        public const string AcceptPrefix = "^{0}.+$";

        /// <summary>
        ///请再次输入相同的值
        /// </summary>
        public const string EqualTo = "";

        /// <summary>
        ///两个字段不一致,通常用于编辑时候父节点
        /// </summary>
        public const string NotEqualTo = "";

        /// <summary>
        /// json正则验证
        /// </summary>
        public const string Json = "";

        /// <summary>
        /// 强密码验证   密码必须包含1个数字、1个大写字母、1个小写字母、1个特殊字符(_#?!@$%^&*-)且长度大于8
        /// </summary>
        public const string StrongPswd = "^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[_#?!@$%^&*-]).{8,}$";

        /// <summary>
        /// 密码加密传输
        /// </summary>
        public const string LoadPswd = "";
    }
文档更新时间: 2022-01-09 20:59   作者:admin