boost-regex

    0熱度

    2回答

    UPDATE:找到一種方法讓它編譯,見下文。 你好,我有問題在cygwin下編譯boost程序。我已經從cygwin項目的setup.exe安裝了默認的boost和g ++包。 在我的Linux系統,我可以通過編譯程序reg.cpp如下: g++ -I/usr/include/boost -lboost_regex -o reg reg.cpp 在Cygwin我必須編輯這個只是有點: g++

    5熱度

    3回答

    我想使用Boost正則表達式來查看它是否有一個整數。 上this page其中一個例子是 bool validate_card_format(const std::string& s) { static const boost::regex e("(\\d{4}[- ]){3}\\d{4}"); return regex_match(s, e); } 還有一個可能是工作

    2熱度

    2回答

    如何找到匹配boost正則表達式的字符串中的索引?如果您使用升壓 int find_match_offset(std::string const& string_to_search, boost::regex const& expression) { boost::smatch results; if(boost::regex_match(string_t

    2熱度

    1回答

    有沒有人有任何想法爲什麼下面的代碼會輸出「不匹配」? boost::regex r(".*\\."); std::string s("app.test"); if (boost::regex_match(s, r)) std::cout << "match" << std::endl; else std::cout << "no match" <<

    0熱度

    1回答

    boost::regex re; re = "(\\d+)"; boost::cmatch matches; if (boost::regex_search("hello 123 world", matches, re)) { printf("Found %s\n", matches[1]); } 結果:「找到123個世界」。我只是想

    0熱度

    1回答

    我一直在努力失敗鏡像,只有符合「A-Z0-9」文本使用下面的代碼: ${1/[a-z]/$0/}${1} 片斷後一直標籤觸發我期望鍵入「$ test」並查看「測試」鏡像。 任何線索? 非常感謝!

    4熱度

    4回答

    對於下面的簡單程序,我得到一個段錯誤。它似乎與析構函數match_results有關。 #include <iostream> #include <vector> #include <string> #include <boost/regex.hpp> using namespace std; int main(int argc, char *argv) { boost:

    7熱度

    4回答

    我試圖在我的程序中使用boost正則表達式 問題是我得到這個錯誤... 唯一的安裝步驟我所做的就是補充: 「C:\ Program Files文件\提升\ boost_1_42」 進入附加包含目錄... 我使用VS2008 ... 想實現這一點: #include <iostream> #include <string> #include <boost/regex.hpp> using n

    1熱度

    1回答

    具體來說,我有一個名爲val的字符串數組,並且想要用val[n]替換輸入中的所有"%{n}%"實例。更一般地說,我希望替換值是匹配值的函數。這是用C++編寫的,所以我使用了Boost,但如果另一個常見的正則表達式庫更符合我的需求,請讓我知道。我發現了一些.NET(C#,VB.NET)解決方案,但我不知道我是否可以在這裏使用相同的方法(或者,如果可以的話,怎麼做)。 我知道有這個醜陋的解決方案:有一

    5熱度

    1回答

    不知道爲什麼我得到我從here下載了libs,而我有一個名爲'libboost_regex-vc90-mt-gd-1_39.lib的庫,我沒有一個名爲'libboost_regex-vc100-mt-gd-1_39.lib'的庫,重命名那個vc90到vc100的作品,但我不確定這是否是理想的解決方案? #include "stdafx.h" #include <regex> #include