当前位置:编程学习 > 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 © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,