Visual Studio 2013兼容性中的C++Regex
C++ Regex from Visual Studio 2013 compatibility
这是我在一次漫长的旅程中的后续操作,我在C++11中使用正则表达式和VS 2013 rc5从解析GLSL着色器文件中提取文本。
以下是监督结果:
实时工作编辑在这里!
C++等价物看起来像这样,它是PHP版本的翻版:
std::smatch u;
std::string s = l_shader->GetData();
std::smatch u;
std::regex_search(s.cbegin(), s.cend(), u, std::regex("<(\S+)[!]>([.*\s*\S*]*?)<[!]\S+>"));
不幸的是,std::regex_search没有返回任何结果。我一直想弄清楚。我错过了什么?
对我来说,这看起来像是一个bug。我可以确认,使用VC++2013,没有任何东西匹配——但使用VC++2015,每个着色器都匹配,正如(我认为)你所期望的那样。
相关文章:
- 将成员变量添加到共享库中的类中,不会破坏二进制兼容性吗
- 此模式的C++RegEx
- C++ std::regex 使用前瞻失败
- 提升序列化 1:73 的向后兼容性问题
- 在gcc中意外调用了Const重载.编译器错误或兼容性修复程序
- 各种版本的 Mac OSX 向后兼容性如何?(Xcode C++
- Visual Studio 19-17 库兼容性根据 GL 标志
- std::regex:匹配由数字和空格组成的字符串,并提取数字.如何?
- C++ ABI 兼容性问题/张量流
- Oracle OCCI 和 g++ 7.1 的兼容性问题
- 为什么库API+编译器ABI足以确保具有不同版本gcc的对象之间的兼容性
- 对指针和恒常性兼容性的引用
- 使用 boost::regex 从目录中获取带有一些正则表达式的文件名称时出现意外输出
- 检查操作系统兼容性
- 你能防止 std::regex 在无效表达式上抛出异常吗?
- 使用Regex解析cpp中的字符串并创建映射
- C++:如何用split查找单词?Regex
- 在VC2015U3上,std::regex比boost::regex慢得多
- 是否有更有效的方法来生成日期的REGEX字符串
- Visual Studio 2013兼容性中的C++Regex