111,126
社区成员
发帖
与我相关
我的任务
分享
string[] txt = File.ReadAllLines(@"C:\1.txt),Encoding.GetEncoding("GB2312"));
for (int i = 0; i < txt.Length; i++)
{
Regex reg = new Regex(@"(?i)(?<=\b[渝]*)\S{6}\b");
Match mm = reg.Match(txt[i]);
if (mm.Success)
{
MessageBox.Show("Lenght is 6");
}
else
{
}
}
string pattern = @"(?i)(?<=[\u4e00-\u9fa5]\s*)\S{6}(?=\s+)";
foreach (string row in File.ReadLines(@"C:\Documents and Settings\Administrator\桌面\Test.txt", Encoding.GetEncoding("GB2312")))
{
if (Regex.IsMatch(row, pattern))
{
}
}
string[] txt = File.ReadAllLines(@"C:\1.txt),Encoding.GetEncoding("GB2312"));
for (int i = 0; i < txt.Length; i++)
{
Regex reg = new Regex(@"渝\S{6}");
Match mm = reg.Match(txt[i]);
if (mm.Success)
{
MessageBox.Show("Lenght is 6");
}
else
{
}
}
string source = @"渝C15X18 2012.02 13326251XX5";
Regex reg = new Regex(@"渝[\S]{6}");
Match mm = reg.Match(source);
if (mm.Success)
{
MessageBox.Show("ok");
}