<XXX>in the set.</XXX>一:xxx是未知个数。
二:要提取里面的字符串。
三:并且要知道xxx字符串是什么!

解决方案 »

  1.   

    <([^>]+)>([^<]+)</\1>Group[1].Value是xxx 
    Group[2].Value是提取的内容不是给你写了吗?难道不行?
      

  2.   

    string text="<XXX>in the set. </XXX>";
    Regex reg=new Regex(@"<([^>]+)>([^<]+)</\1>");
    Match m=reg.Match(text);
    string str=m.Group[1].Value;//提取XXX
    string result=m.Group[2].Value;//提取in the set.