手机号正则表达式

时间:2014-06-02 02:11:42   收藏:0   阅读:394

^[1][3-8]+\\d{9}

^首字母
[1]必须是1,方格可以去掉吧。。
[3-8]第二个数字为3-8之间
+加表示至少一个[3-8]
\\d表示数字
{9}表示9个,就是9个数字。

bubuko.com,布布扣
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading;
 
namespace ConsoleApplication1 {
    class Program {
        public static object _obj = new object();
 
        public static void Main() {
            Regex Regex = new Regex(@"^(86)*0*13\d{9}$");
            Console.WriteLine(Regex.IsMatch("13565264258"));
            Console.WriteLine(Regex.IsMatch("13565264258...."));
            Console.ReadLine();
        }
    }
}
bubuko.com,布布扣

 

 

手机号正则表达式,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!