Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
非常简单的C++;带有RegExp的代码在Android上崩溃,但在OSX上运行良好 我有一个简单的C++代码,带有Android的ReXEP崩溃,但是在OS X:上运行良好。 std::string str = "1x0-4x0"; std::regex regexRule( "([0-9]+)x([0-9]+)-([0-9]+)x([0-9]+)" ); std::smatch piecesMatch; if ( std::regex_match( str, piecesMatch, regexRule ) ) std::cout << "regex_match!\n"; std::string str=“1x0-4x0”; std::regex regexRule(([0-9]+)x([0-9]+)-([0-9]+)x([0-9]+)); std::smatch片段smatch; if(std::regex_匹配(str、piecesMatch、regexRule)) gcc的早期版本在C++11上没有完全的支持。你可以在NDK中检查版本_C++_Regex_C++11 - Fatal编程技术网

非常简单的C++;带有RegExp的代码在Android上崩溃,但在OSX上运行良好 我有一个简单的C++代码,带有Android的ReXEP崩溃,但是在OS X:上运行良好。 std::string str = "1x0-4x0"; std::regex regexRule( "([0-9]+)x([0-9]+)-([0-9]+)x([0-9]+)" ); std::smatch piecesMatch; if ( std::regex_match( str, piecesMatch, regexRule ) ) std::cout << "regex_match!\n"; std::string str=“1x0-4x0”; std::regex regexRule(([0-9]+)x([0-9]+)-([0-9]+)x([0-9]+)); std::smatch片段smatch; if(std::regex_匹配(str、piecesMatch、regexRule)) gcc的早期版本在C++11上没有完全的支持。你可以在NDK中检查版本

非常简单的C++;带有RegExp的代码在Android上崩溃,但在OSX上运行良好 我有一个简单的C++代码,带有Android的ReXEP崩溃,但是在OS X:上运行良好。 std::string str = "1x0-4x0"; std::regex regexRule( "([0-9]+)x([0-9]+)-([0-9]+)x([0-9]+)" ); std::smatch piecesMatch; if ( std::regex_match( str, piecesMatch, regexRule ) ) std::cout << "regex_match!\n"; std::string str=“1x0-4x0”; std::regex regexRule(([0-9]+)x([0-9]+)-([0-9]+)x([0-9]+)); std::smatch片段smatch; if(std::regex_匹配(str、piecesMatch、regexRule)) gcc的早期版本在C++11上没有完全的支持。你可以在NDK中检查版本,c++,regex,c++11,C++,Regex,C++11,CentOS 7上的gcc-4.8.5 terminate called after throwing an instance of 'std::regex_error' what(): regex_error Aborted (core dumped) gcc-5.2.1 regex_match! 您可能在GCC4.8中使用NDK版本。自gcc 4.9以来,正式宣布支持regex。NDK在最新版本(即11b)中使用gcc 4.9 另请参见此处:您在Android上使用的NDK是什么?

CentOS 7上的gcc-4.8.5

terminate called after throwing an instance of 'std::regex_error'
  what():  regex_error
Aborted (core dumped)
gcc-5.2.1

regex_match!

您可能在GCC4.8中使用NDK版本。自gcc 4.9以来,正式宣布支持regex。NDK在最新版本(即11b)中使用gcc 4.9


另请参见此处:

您在Android上使用的NDK是什么?什么gcc版本?@Thomas-如果我只使用“\-”我会在XCode中得到一个警告:未知转义序列“\-”@Thomas-我刚刚删除了“\”,但结果是一样的。现在我的正则表达式是:([0-9]+)x([0-9]+)-([0-9]+)x([0-9]+)@JAvaRunner,但正则表达式中的
\-
是什么意思?我很确定你不必逃避——在群组之外。GCC4.8实现了一个非常糟糕的正则表达式版本。基本上,什么都不管用。我把NDK更新到最新版本,现在我用gcc-4.9而不是4.8。现在它工作得很好。谢谢。实际上在NDK11中,GCC4.8被删除,GCC4.9用于所有目标。但正如我看到的,4.9已经有一段时间可用了——正如我看到的,自NDK v以来。10