using System.Text.RegularExpressions;

namespace DeviceRepairAndOptimization.Utils
{
    public class RexEX
    {
        /// <summary>
        /// 匹配输入的是否为邮箱
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public static bool EmailMatch(string input)
        {
            return Regex.IsMatch(input, @"\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}");
        }

        /// <summary>
        /// 匹配输入的是否为手机号码
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public static bool TaxMatch(string input)
        {
            return Regex.IsMatch(input, @"0?(13|14|15|18|17)[0-9]{9}");
        }
    }
}
