#region 过滤p /p代码
    /// <summary>
    /// 过滤p /p代码
    /// </summary>
    /// <param name="html">参数传入</param>
    /// <returns></returns>
    public static string InputStr(string html)
    {
        html = html.Replace(@"<p>", "");
        html = html.Replace(@"</p>", "");
        return html;
    }
    #endregion
参考这个

解决方案 »

  1.   

    正则都不好????
                    String str = "<font>中国 <标题>上海 </font> ";
                    str=str.Substring(str.IndexOf(">") + 1, str.LastIndexOf("<") - str.IndexOf(">") - 1);
      

  2.   

    匹配字符首選正則表達式...
    樓主直接讀網頁源碼... 網頁源碼里面 "<标题>" 存的并不是 尖括號的... ... 是"& lt;" , "& gt;"
    所以你匹配尖括号是OK的
      

  3.   

    有这么麻烦么?就用操作Html文档类的InnerText属性
      

  4.   


    string input = "<font>中国 <标题>上海 </font>";
    Regex re = new Regex("(?is)(?<=<font>).*?(?=</font>)");
    Console.WriteLine(re.Match(input).Value);
      

  5.   

    谢谢大家的点评啊
       除了 正则表达式 还有什么更好的办法吗?
      最好是用 webBrowser 我不知道怎么用 webBrowser
      

  6.   

          String str = " <font>中国 <标题>上海 </font> "; 
         str = str.Substring(str.IndexOf(">") + 1, str.LastIndexOf(" <") - str.IndexOf(">") - 1);这一种不错