如题。

解决方案 »

  1.   

    http://baike.baidu.com/view/94238.html?wtp=tt
    百度下就OK了
      

  2.   

    看看这个贴子的例子:
    http://topic.csdn.net/u/20090913/20/13145e3c-32fb-49da-978c-0b06244667ac.htmlusing System; 
    using System.IO;
    using System.Text;
    using System.Collections.Generic;
    using System.Text.RegularExpressions; class Program 

      static void Main() 
      { 
        using (StreamReader sr = new StreamReader("abc.txt", Encoding.GetEncoding("GB18030")))
        {
          string text = sr.ReadToEnd();
          // Console.WriteLine(text); 
          List<string> list = new List<string>();
          foreach (Match m in Regex.Matches(text, @"(?<=\*).{2}-\d+(?=\*)"))
          {
            list.Add(m.Value);
          }
          string[] array = list.ToArray(); // 这就是你要的车牌号数组。
          
          foreach (string s in array)
            Console.WriteLine(s); 
        }
      } 

    其中正则表达式:
    @"(?<=\*).{2}-\d+(?=\*)"
    (?<=\*) 表示左边是 * 字符,正则式中 * 有特殊含义,需要用 \ 转义,
    .{2} 匹配任意字符正好2次,
    - 匹配 - 字符本身,
    \d+ 匹配数字字符一次或多次,
    (?=\*) 表示右边是 * 字符。
      

  3.   

    看看这个贴子的例子:
    http://topic.csdn.net/u/20090913/20/13145e3c-32fb-49da-978c-0b06244667ac.htmlusing System; 
    using System.IO;
    using System.Text;
    using System.Collections.Generic;
    using System.Text.RegularExpressions; class Program 

      static void Main() 
      { 
        using (StreamReader sr = new StreamReader("abc.txt", Encoding.GetEncoding("GB18030")))
        {
          string text = sr.ReadToEnd();
          // Console.WriteLine(text); 
          List<string> list = new List<string>();
          foreach (Match m in Regex.Matches(text, @"(?<=\*).{2}-\d+(?=\*)"))
          {
            list.Add(m.Value);
          }
          string[] array = list.ToArray(); // 这就是你要的车牌号数组。
          
          foreach (string s in array)
            Console.WriteLine(s); 
        }
      } 

    其中正则表达式:
    @"(?<=\*).{2}-\d+(?=\*)"
    (?<=\*) 表示左边是 * 字符,正则式中 * 有特殊含义,需要用 \ 转义,
    .{2} 匹配任意字符正好2次,
    - 匹配 - 字符本身,
    \d+ 匹配数字字符一次或多次,
    (?=\*) 表示右边是 * 字符。
      

  4.   

    网上教程:
    http://unibetter.com/deerchao/zhengzhe-biaodashi-jiaocheng-se.htm
    另外,推荐一本书: