首页 > 移动平台 > 详细

匹配手机号

时间:2014-06-02 01:33:42      阅读:375      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
 1             //FileStream fs = new FileStream(@"C:\Users\Alex\Desktop\Task.txt", FileMode.Open, FileAccess.Read);
 2             //StreamReader sr = new StreamReader(fs);
 3 
 4             #region "Read Content"
 5             StreamReader sr = new StreamReader(@"C:\Users\Alex\Desktop\Task.txt", Encoding.GetEncoding("gb2312"));
 6             string content = sr.ReadToEnd();
 7 
 8             sr.Close();
 9 
10             Console.WriteLine(content);
11 
12             Regex rx = new Regex(@"1[3-8]\d{9}");
13             MatchCollection matches = rx.Matches(content);
14             Console.WriteLine(matches.Count);
15             foreach (Match match in matches)
16             {
17                 Console.WriteLine(match.Value);
18             }
19             Console.ReadKey();
20             #endregion
bubuko.com,布布扣

 

匹配手机号,布布扣,bubuko.com

匹配手机号

原文:http://www.cnblogs.com/daishuguang/p/3763784.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!