当前位置:编程学习 > VC++ >>

vc++ greta html转 txt

 

CString html2txt(CString html) 

        CString m_strReg="<script[^>]*?>.*?</script>|<style[^>]*?>.*?</style>|<[\\/\\!]*?[^<>]*?>|<![\\s\\S]*?--[ \\t\\n\\r]*>"; 

        CString m_strResult = ""; 

          REGEX_FLAGS dw = GLOBAL | ALLBACKREFS | NOCASE; 

      

        rpattern pat((LPCTSTR)m_strReg, "", dw); 

        subst_results subResult; 

      

        string str((LPCTSTR)html); 

        int nCount = pat.substitute(str, subResult); 

        m_strResult = str.c_str(); 

        return m_strResult; 

}   

摘自 zzz_781111的专栏

补充:软件开发 , Vc ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,