<url>192.168.0.1/ppush/index.jsp</url><msg charset="gb2312">好,好好20好好</msg>
===>
192.168.0.1/ppush/index.jsp好,好好20好好

解决方案 »

  1.   

    你要的正则表达式:(?<=<.+?>)[^<]+?(?=</.+?>)string s=@"<url>192.168.0.1/ppush/index.jsp</url><msg charset=""gb2312"">好,好好20好好</msg>";
    string myRegex=@"(?<=<.+?>)[^<]+?(?=</.+?>)";
    System.Text.RegularExpressions.MatchCollection mc;
    mc=System.Text.RegularExpressions.Regex.Matches(s,myRegex,System.Text.RegularExpressions.RegexOptions.Multiline); 
    string resultString=string.Empty; 
    foreach (System.Text.RegularExpressions.Match m in mc) {
    resultString +=m.Value; 
    }
    MessageBox.Show( resultString);