string input=@"<p>\r\n uuuu</p>\r\n";//这样为什么就能mactch到
string input = @message; //message="<p>\r\n uuuu</p>\r\n"; //我这样写为什么就match不到?或者@这个地方应该怎么写?Match m=Regex.Match(input,@"<([^>]+)>\S*(.*?)</\1>\S*");
string value=m.Groups[2].Value;

解决方案 »

  1.   

    你把那个input输出来看下。。是什么样的
      

  2.   


    string input1=@"<p>\r\n uuuu</p>\r\n";//这样为什么就能mactch到
    string input2 = @message; //message="<p>\r\n uuuu</p>\r\n"; //我这样写为什么就match不到?或者@这个地方应该怎么写?Match m=Regex.Match(input1,@"<([^>]+)>\S*(.*?)</\1>\S*");
    m="{<p>\r\n uuuu</p>\r\n}";
    string value=m.Groups[2].Value;
    value = uuuu;
    Match m=Regex.Match(input2,@"<([^>]+)>\S*(.*?)</\1>\S*");
    m="{}" //这就空了
    string value=m.Groups[2].Value;
      

  3.   


    input1 = "<p>\\r\\n uuuu</p>\\r\\n";
    input2 = "<p>\r\n uuuu</p>\r\n"; //为什么上面是俩斜杠呢? 这应该怎么办?
      

  4.   

    http://blog.csdn.net/auto_ptr/article/details/6323635
    message="<p>\\r\\n uuuu</p>\\r\\n";这样试试