Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/144.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++ C++;叮当声可以';t分析这个Lookbehind正则表达式_C++_Regex_C++11_Clang - Fatal编程技术网

C++ C++;叮当声可以';t分析这个Lookbehind正则表达式

C++ C++;叮当声可以';t分析这个Lookbehind正则表达式,c++,regex,c++11,clang,C++,Regex,C++11,Clang,根据regex101.com和我称之为“RegExRx”的应用程序,这是一个有效的正则表达式 (?<=\().* (?您使用的构造函数是: explicit basic_regex( const CharT* s, flag_type f = std::regex_constants::ECMAScript ); 这表明默认的正则表达式格式是ECMAScript(或者我们大多数人都知道的javascript) 如果将regex101.com中

根据regex101.com和我称之为“RegExRx”的应用程序,这是一个有效的正则表达式

(?<=\().*

(?您使用的构造函数是:

explicit basic_regex( const CharT* s,
                      flag_type f = std::regex_constants::ECMAScript );
这表明默认的正则表达式格式是ECMAScript(或者我们大多数人都知道的javascript)

如果将regex101.com中的regex flavor设置为javascript而不是pcre,则会看到相同的错误:
(?
无法识别,因此
没有任何匹配项


请注意,allow Lookahead或lookbehind都不支持。

C++11使用ECMAScript的正则表达式语法,不支持lookbehind

上述正则表达式的等价物如下所示-

\\((.*)
注意:捕获组
(…)
保留开括号后面的所有内容


在C++11正则表达式中没有后顾之忧。这给了我前进的道路。非常有用,谢谢。@MatthewJamesBriggs,很高兴我能提供帮助。
\\((.*)