この C++ コードの一部が永久にブロックされるのはなぜですか?
string word = " a\n";
regex indent("^( |\t)*");
word = regex_replace(word, indent, "");
また、この C++ コードの一部がすぐに終了するのはなぜですか?
string word = " a\n";
regex indent("^( |\t)+");
word = regex_replace(word, indent, "");
さらにひねりを加えると、なぜこれはすぐに終了するのでしょうか?
string word = " a\n";
regex indent("^( |\t)+?");
word = regex_replace(word, indent, "");
私はそれ"^( |\t)+?"
が"^( |\t)*"
libc++ と llvm および標準の c++ 正規表現ライブラリを使用しています。