Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有简单的代码不起作用。它抛出这个错误:what(): regex_error,我不知道为什么。谢谢你的帮助。我试图用这个标志编译它:-std=c++11。
#include <iostream> #include <regex> int main() { std::regex r("[1-9]{4}"); std::cout << "result: " << std::regex_match("1524", r) << '\n'; return 0; }