std::regex crashes when matching long lines. Here is an example: #include <regex> #include <iostream> int main() { std::string s (100'000, '*'); std::smatch m; std::regex r ("^(.*?)$"); std::regex_search (s, m, r); std::cout << s .substr (0, 10) << std::endl; std::cout << m .str (1) .substr (0, 10) << std::endl; } It turns out that std::regex_search operator .* is implemented recursively which result in this example in a stack overflow.
Dup. *** This bug has been marked as a duplicate of bug 86164 ***