you can assign the 组名 yourselfRegex re = new Regex("<td>([^<]+)</td>");
Match m = re.Match(YourString);
if (m.Success)
  Console.WriteLine(m.Groups[1].Value);Regex re = new Regex("<td>(?<content>[^<]+)</td>");
Match m = re.Match(YourString);
if (m.Success)
  Console.WriteLine(m.Groups["content"].Value);

解决方案 »

  1.   

    我现在想法是
    让用户在前面输入原始文本和正则表达式
    然后我分析其中有没有指定组名
    如果指定了,就取出来.显示到结果中.
    就是类似要这么一个东西:Groups[i].Name
    但是没有?
    我现在想到的方法是再对这个用户输入的表达式应用正则分析
    取得他指定的组名.
    不知道是不是该这样做?第一个问题是不是除了用m.Groups[1].Value之外别无他法?
    就是说必须要用Groups?
      

  2.   

    don't want to misunderstand what you want, show an example and tell us what you want
      

  3.   

    我就是要这个东西阿 r.GroupNameFromNumber(i)
    今天刚找到.
    思归这厮...:).关于第一个问题,我看其它一些资料.模糊觉得就是类似这样取出(不用Group) $1,$2....