Files
libcifpp/cmake/test-rx.cpp
Maarten L. Hekkelman 0b5d28338e replacing std::endl where appropriate
more docs
2023-09-12 09:06:45 +02:00

19 lines
313 B
C++

// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86164
#include <iostream>
#include <regex>
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) << '\n';
std::cout << m.str(1).substr(0, 10) << '\n';
return 0;
}