-2
#include <regex>
#include <string>
#include <iostream>
using namespace std;
bool IsMatched()
{
string str = R"(Liy_0-3863)";
string re = R"([:\-_a-zA-Z\d]+)";
auto flags = std::regex_constants::ECMAScript;
return std::regex_match(str.data(),
std::regex(re.data(), re.size(), flags));
}
int main()
{
cout << boolalpha << IsMatched();
}
- 鐺4.0輸出
true
; - gcc 6.2輸出
false
。
這是誰的bug - clang或gcc?這是誰的bug - clang或gcc?
海灣合作委員會幹線打印'真實',所以我認爲答案是顯而易見的。 –
問題標題很具誤導性。這個問題永遠無法通過搜索找到。請使標題更具描述性,並將關鍵字添加到正則表達式中。 –
@瑞安這是這個\ - –