Strange results when using C++11 regexp with gcc 4.8.2 (but works with Boost regexp) [duplicate]
问题 This question already has answers here : Is gcc 4.8 or earlier buggy about regular expressions? (3 answers) Closed 5 years ago . I tried to use C++11's regular expression but failed even in trivial examples. From the outside, it seems to only compare the strings, for example: std::regex_match(std::string{""}, std::regex{"a?"}) // false (???) std::regex_match(std::string{"a?"}, std::regex{"a?"}) // true (???) In contrast, the Boost's regexp library behaves as I would have expected: boost: