internal class Program
{
private static void Main(string[] args)
{

var content = Read(@"E:\workspace\日志\2016-06-21.LOG2016-06-21.LOG");
Regex reg3 = new Regex(@"手机号(?<result>(\d+)?)");
var matches = reg3.Matches(content);
if (matches.Count > 0)
{
var list = new List<string>();
string phone;
foreach (Match item in matches)
{
phone = item.Result("${result}");
if (list.Contains(phone))
{

}
else
{
list.Add(phone);
}
}
}
}

public static string Read(string path)
{
StreamReader sr = new StreamReader(path, Encoding.Default);
String line;
StringBuilder sb = new StringBuilder();
while ((line = sr.ReadLine()) != null)
{
sb.AppendLine(line);

}
return sb.ToString();

}
}

相关文章:

  • 2022-12-23
  • 2021-09-14
  • 2021-11-03
  • 2022-02-07
  • 2022-02-13
猜你喜欢
  • 2021-11-03
  • 2021-09-09
  • 2022-12-23
  • 2021-06-04
  • 2021-11-04
  • 2021-06-24
  • 2022-12-23
相关资源
相似解决方案