boost-regex

    2熱度

    1回答

    我想使用boost正則表達式庫,但我無法設法編譯我的程序。涉及類似錯誤消息的所有相關問題似乎與正則表達式庫沒有正確鏈接的情況有關。我認爲我在連接它,但也許我正在做一些愚蠢的事情......也許有人看到我的錯誤? 這裏是我的測試程序: // ~/workspace/test/test.cpp #include <string> #include <iostream> #include <boo

    2熱度

    1回答

    我正在使用下面的代碼嘗試使用正則表達式匹配符號(例如,我試圖匹配圓形星符號,http://graphemica.com/%E2%9C%AA ) #include <boost/regex.hpp> //... std::wstring text = L"a✪c"; auto re = L"(\\p{S}|\\p{L})+?"; boost::wregex r(re); boost::r

    0熱度

    2回答

    我想用boost::regex一堆的格式19991231235959日期的格式更改爲這種格式1999-12-31_23:59:59這樣的: YYYYMMDDhhmmss --> YYYY-MM-DD_hh:mm:ss 19991231235959 --> 1999-12-31_23:59:59 我用這個 std::string input = "19991231235959"; boost

    0熱度

    2回答

    我是新來的android和我想要一個應用程序檢查句子與句子的匹配。爲此,我使用stanford tregex工具,並將4個jar文件包括到我的項目庫中。在運行時我得到了一個錯誤,在控制檯告訴無法執行dex:多個dex文件定義Ledu/stanford/nlp/graph/Connected Components ...我不知道爲什麼......我需要爲此做些什麼.. 。請解釋 TregexPatt

    1熱度

    1回答

    我正在捕獲boost :: circular_buffer中的數據,並且想要現在對內容執行正則表達式搜索,但我在獲取boost :: regex以瞭解如何查看緩衝區方面遇到了一些困難。 這裏的之類的事情的一個精簡版,我想基於示例here做: // Set up a pre-populated data buffer as an example std::string test = "Fl

    8熱度

    1回答

    我想匹配一些數據流中有趣的數據塊。 應該有一個領先的<,然後是四個字母數字字符,兩個校驗和(或??,如果沒有指定shecksum)和一個尾隨>。 如果最後兩個字符是字母數字,則以下代碼按預期工作。如果他們是??雖然它失敗了。 // Set up a pre-populated data buffer as an example std::string haystack = "Fli<data??

    3熱度

    2回答

    string emailBody = " holla holla testing is for NewFinancial History:\"xyz\" dsd NewFinancial History:\"abc\" NewEBTDI$:\"abc\" dsds "; emailBody = string.Join(" ", Regex.Split(emailBody.Trim(),

    2熱度

    2回答

    我想在Ubuntu 12.04(gcc 4.8.2)上使用boost_regex。 我已經安裝了這樣的提升。 $ sudo apt-get install libboost-all-dev 而且我已經確認安裝了boost_regex庫。 $ ls /usr/lib/x86_64-linux-gnu | grep regex libboost_regex.a libboost_regex.s

    0熱度

    1回答

    #include <iostream> #include <regex> int main(void) { std::cmatch cm; std::regex_match("subject", cm, std::regex("(sub)(.*)")); //std::for_each(cm.begin(), cm.end(), [](const std::su

    2熱度

    3回答

    我想知道是否可以調用子程序,但不捕獲該調用的結果。 舉例來說,假設我想遞歸匹配和捕獲平衡括號{}結構像 {dfsdf {sdfdf {{dfsdf}}} dfsf} 我可以使用這正則表達式: (^(?'nest'\{(?>[^{}]|(?&nest))*\})) 第一組是我想要捕獲。 但是我的 '鳥巢' 的定義: (?'nest' ...) 和我的 '鳥巢' 子程序遞歸調用: (?&nes