try the following:using System;
using System.Text.RegularExpressions;class RegTest
{
  public static void Main()
  { String str = "08SEP(SUN) KMGPEK VIA 3Q 1- 3Q4121 KMGPEK 0735 1035 767 0 M FA D4 YA BA KA HA MA WA LA NS ES XS VS OC GS Q5 SS TS PS US Z1 2 3Q4611 KMGPEK 1025 1340 733 0 M YA BA KA HA MA WA LA NS ES XS VS OC GS Q3 SS TS PS US Z4 3+ 3Q4183 KMGPEK 1525 1825 733 0 M YA BA KA HA MA W1 LS NS ES XS VS OC GS Q5 SS TS PS US ZS €"; Regex re = new Regex(@"(3Q\d{4}\s+.*?Z[^\s]+\s+)"); MatchCollection mc = re.Matches(str);
for (int i=0; i < mc.Count; i++)
{
Console.WriteLine(mc[i].Result("$1"));
}

  }}

解决方案 »

  1.   

    真是很强,那么快救出来了,我想了很久~~能留个msn吗?我的[email protected]
      

  2.   

    能不能再细分一些3Q4121 KMGPEK 0735 1035 767 0 M FA D4 YA BA KA HA MA WA LA NS ES XS VS OC GS Q5 SS TS PS US Z1分成{"3Q4121","KMGPEK","0735"....}分一会就结~
      

  3.   

    (@"(3Q\d{4}\s+.*?Z[^\s]+\s+)");
    厉害啊
    不过那个思归真的很厉害啊!
      

  4.   

    use String[] sList = Regex.Split(str, @"\s+");you will get all tokens
      

  5.   

    我也写了一个。呵呵!只是没思归大哥的漂亮。
    大家交流一下吧!:)
    [STAThread]
    static void Main(string[] args)
    {
    String str = "08SEP(SUN) KMGPEK VIA 3Q 1- 3Q4121 KMGPEK 0735 1035 767 0 M FA D4 YA BA KA HA MA WA LA NS ES XS VS OC GS Q5 SS TS PS US Z1 2 3Q4611 KMGPEK 1025 1340 733 0 M YA BA KA HA MA WA LA NS ES XS VS OC GS Q3 SS TS PS US Z4 3+ 3Q4183 KMGPEK 1525 1825 733 0 M YA BA KA HA MA W1 LS NS ES XS VS OC GS Q5 SS TS PS US ZS €";
    int startIndex1=str.IndexOf("3Q4121");
    int startIndex2=str.IndexOf("3Q4611");
    int startIndex3=str.IndexOf("3Q4183");
    String str1=str.Substring(startIndex1,startIndex2-startIndex1-2);
    String str2=str.Substring(startIndex2,startIndex3-startIndex2-3);
    String str3=str.Substring(startIndex3,str.Length-startIndex3-1);
    Console.WriteLine(str1);
    Console.WriteLine(str2);
    Console.WriteLine(str3);

    思归大哥用的是正则表达式。可俺不懂那东东。5555555555555
      

  6.   

    hehe~3Q后的东西会变的,不是每次都一样~