{"id":1373,"date":"2014-10-15T17:23:18","date_gmt":"2014-10-15T09:23:18","guid":{"rendered":"http:\/\/www.youthtribe.com\/?p=1373"},"modified":"2014-10-15T17:23:53","modified_gmt":"2014-10-15T09:23:53","slug":"vc%e5%a6%82%e4%bd%95%e6%ad%a3%e5%88%99%e5%8c%b9%e9%85%8d%e5%87%ba%e5%a4%9a%e6%9d%a1%e7%9b%b8%e5%90%8c%e7%b1%bb%e4%bc%bc%e8%ae%b0%e5%bd%95-regex","status":"publish","type":"post","link":"http:\/\/www.youthtribe.com\/archives\/1373","title":{"rendered":"vc\u5982\u4f55\u6b63\u5219\u5339\u914d\u51fa\u591a\u6761\u76f8\u540c\u7c7b\u4f3c\u8bb0\u5f55-[regex]"},"content":{"rendered":"

\u56e0\u4e3a\u6211\u5bf9\u8fd9\u4e2acmathresult\u6a21\u7248\u7c7b\u4e0d\u61c2\uff0c\u6240\u4ee5\u6211\u7684\u65b9\u6cd5\u5c31\u662f\uff0c\u6bcf\u627e\u5230\u4e00\u4e2a\u5339\u914d\u9879\uff0c\u90a3\u5c31\u628a\u4ed6\u66ff\u6362\u4e3a\u7a7a\uff0c\u8fd9\u6837\u5faa\u73af\u4e0b\u53bb\uff0c\u76f4\u5230\u5f97\u4e0d\u5230\u6b63\u5219\u5339\u914d\u9879\u4e3a\u6b62\u3002<\/p>\n

\r\n\/\/just for google\r\nbool CURLCollectorDlg::GetMatchCString2(CString strSearch, CString strBegin, CString strEnd ,CStringArray &arr)\r\n{\r\n\tCString strReturn;\r\n\t\/\/MessageBox(\"str\" + strSearch);\r\n\tstd::string str(strSearch.GetBuffer());\r\n\t\/\/\u6b63\u5219\u89c4\u5219\r\n\tstd::string strbegin,strend,strreg;\r\n\tstrbegin = strBegin.GetBuffer();\r\n\tstrend = strEnd.GetBuffer();\r\n\tstrreg = \"(.*?)\";\r\n\tstrreg = strbegin + strreg + strend;\r\n\tstd::regex reg(strreg);\r\n\t\/\/flag\r\n\tstd::regex_constants::match_flag_type f = std::regex_constants::match_any;\r\n\t\/\/\u5b58\u653e\u5339\u914d\u51fa\u6765\u5b57\u7b26\u4e32\r\n\tstd::match_results mr;\r\n\r\n\tif (std::regex_search(str,mr,reg,f))\r\n\t{\r\n\t\tAddStatus(\"\u5339\u914d\u6210\u529f\");\r\n\t} \r\n\telse\r\n\t{\r\n\t\tAddStatus(\"\u5339\u914d\u5931\u8d25\");\r\n\t\treturn false;\r\n\t}\r\n        \/\/\u8fd9\u4e2awhile\u5faa\u73af\u662f\u6838\u5fc3\u4ee3\u7801\r\n\twhile(std::regex_search(str,mr,reg,f))\r\n\t{\r\n\t\tstd::string s(mr.str());\r\n\t\tstrReturn = s.c_str();\r\n\t\t\/\/\u5f00\u59cb\u66ff\u6362\r\n\t\tCString newstr;\r\n\t\tnewstr = str.c_str();\r\n\t\tnewstr.Replace(strReturn,\"\");\r\n\t\tstr = newstr.GetBuffer(0);\r\n\t\t\/\/\r\n\t\tstrReturn.Replace(strBegin,\"\");\r\n\t\tstrReturn.Replace(strEnd,\"\");\r\n\t\tstrReturn.Replace(\"\",\"\");\r\n\t\tstrReturn.Replace(\"<\/b>\",\"\");\r\n\t\t\/\/AddOneURL(\"\u5339\u914d\u5230\u7684\u7f51\u5740:\" + strReturn);\r\n\r\n\r\n\t\t\/\/str = str.replace(s,\"\",);\r\n\t\tarr.Add(strReturn);\r\n\r\n\r\n\r\n\t}\r\n\treturn false;\r\n\t\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u56e0\u4e3a\u6211\u5bf9\u8fd9\u4e2acmathresult\u6a21\u7248\u7c7b\u4e0d\u61c2\uff0c\u6240\u4ee5\u6211\u7684\u65b9\u6cd5\u5c31\u662f\uff0c\u6bcf\u627e\u5230\u4e00\u4e2a\u5339\u914d\u9879\uff0c\u90a3\u5c31\u628a\u4ed6\u66ff\u6362\u4e3a\u7a7a\uff0c\u8fd9\u6837\u5faa\u73af\u4e0b\u53bb\uff0c\u76f4\u5230\u5f97\u4e0d\u5230\u6b63\u5219\u5339\u914d\u9879\u4e3a\u6b62\u3002 \/\/just for google bool CURLCollectorDlg::GetMatchCString2(CString strSearch, CString strBegin, CString strEnd ,CStringArray &arr) { CString strReturn; \/\/MessageBox(“str” + strSearch); std::string str(strSearch.GetBuffer()); \/\/\u6b63\u5219\u89c4<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[219,9],"tags":[245,144,246,247],"_links":{"self":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1373"}],"collection":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/comments?post=1373"}],"version-history":[{"count":2,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1373\/revisions"}],"predecessor-version":[{"id":1375,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1373\/revisions\/1375"}],"wp:attachment":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/media?parent=1373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/categories?post=1373"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/tags?post=1373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}