why does this piece of C++ code block forever?
string word = " a\n";
regex indent("^( |\t)*");
word = regex_replace(word, indent, "");
and why does this piece of C++ code terminate quickly?
string word = " a\n";
regex indent("^( |\t)+");
word = regex_replace(word, indent, "");
and to add one more twist why does this terminate quickly?
string word = " a\n";
regex indent("^( |\t)+?");
word = regex_replace(word, indent, "");
I would expect that "^( |\t)+?"
would be the same as "^( |\t)*"
I am using libc++ and llvm and the standard c++ regex library.