regexp exp = new regexp("mystr\((.*),(.*),(.*),(.*)\)")
然后循环读取匹配的子项,对每一个匹配的子项match[1],match[2],match[3],match[4]就是你想要的数据了

解决方案 »

  1.   

    Regex r = new Regex( @"mystr\((?<str1>\w+),(?<str2>\w+),(?<str3>\w+),(?<str4>\w+)\)" );Match m = r.Match( yourstring );while ( m.Success )
    {
      COnsole.WriteLine( "Splited String:{0}\t{1}\t{2}\t{3}" , m.Groups[ "str1" ].Value ,
    m.Groups[ "str2" ].Value ,m.Groups[ "str3" ].Value ,m.Groups[ "str3" ].Value );
    }
      

  2.   

    "mystr\((.*),(.*),(.*),(.*)\)"
    可能会匹配
    mystr(asd,asd,asd,asd,asd,asd,asd,sd)
      

  3.   

    @"mystr\((?<str1>[^,]+),(?<str2>[^,]+),(?<str3>[^,]+),(?<str4>[^,]+)\)"