2
有沒有人有任何想法爲什麼下面的代碼會輸出「不匹配」?Boost.Regex oddity
boost::regex r(".*\\.");
std::string s("app.test");
if (boost::regex_match(s, r))
std::cout << "match" << std::endl;
else
std::cout << "no match" << std::endl;
+1 - 「確定正則表達式e和所有字符序列之間是否存在精確匹配」。見http://www.boost.org/doc/libs/1_40_0/libs/regex/doc/html/boost_regex/ref/regex_match.html – 2009-10-08 15:04:13
雖然我認爲他真的想'regex_search()'。 – 2009-10-08 15:05:17
確實,就是這樣。 我現在覺得很愚蠢。 不過,謝謝你的回答 – ldx 2009-10-08 15:10:44