File size: 313 Bytes
2e3030d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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;
}