去掉註釋換行等

std::string s = "select * form aaa  \n /*mmmuuu*/  \n \n yuan hs";
boost::xpressive::sregex reg1 = boost::xpressive::sregex::compile("(\\n)|^(//.*? \\n\\s*)|(/\\*(.|\\n)*?\\*/\\s*)");  
std::string sEx = boost::xpressive::regex_replace(s, reg1, "");
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章