Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.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++ TR1 regex_是否在VS2010中替换为wstring? #包括 #包括 #包括 #包括 #包括 使用名称空间std; int main() { 常数wstr(L“); 静态常数wregex wr(wstr); W字符串行(L“随机文本”); wstring line2(L“); wcout_C++_Regex_Tr1 - Fatal编程技术网

C++ TR1 regex_是否在VS2010中替换为wstring? #包括 #包括 #包括 #包括 #包括 使用名称空间std; int main() { 常数wstr(L“); 静态常数wregex wr(wstr); W字符串行(L“随机文本”); wstring line2(L“); wcout

C++ TR1 regex_是否在VS2010中替换为wstring? #包括 #包括 #包括 #包括 #包括 使用名称空间std; int main() { 常数wstr(L“); 静态常数wregex wr(wstr); W字符串行(L“随机文本”); wstring line2(L“); wcout,c++,regex,tr1,C++,Regex,Tr1,部分答案: 您应该这样使用regex\u repalce: ClCompile: html.cpp c:\users\usr\documents\visual studio 2010\projects\html\html\html.cpp(34): error C2784: std::basic_string<_Elem> std::tr1::regex_replace(const std::basic_string<_Elem> &,const std::t

部分答案:

您应该这样使用
regex\u repalce

ClCompile:
  html.cpp
c:\users\usr\documents\visual studio 2010\projects\html\html\html.cpp(34): error C2784: std::basic_string<_Elem> std::tr1::regex_replace(const std::basic_string<_Elem> &,const std::tr1::basic_regex<_Elem,_RxTraits> &,const std::basic_string<_Elem> &,std::tr1::regex_constants::match_flag_type): not able to output argument template "const std::tr1::basic_regex<_Elem,wchar_t> &" from "const std::tr1::wregex"
          c:\program files\microsoft visual studio 10.0\vc\include\regex(2739): look to typedef "std::tr1::regex_replace"
c:\users\usr\documents\visual studio 2010\projects\html\html\html.cpp(34): error C2784: std::basic_string<_Elem> std::tr1::regex_replace(const std::basic_string<_Elem> &,const std::tr1::basic_regex<_Elem,_RxTraits> &,const std::basic_string<_Elem> &,std::tr1::regex_constants::match_flag_type): not able to output argument template for "const std::tr1::basic_regex<_Elem,wchar_t> &" from "const std::tr1::wregex"
          c:\program files\microsoft visual studio 10.0\vc\include\regex(2739): look to  typedef of "std::tr1::regex_replace"
c:\users\usr\documents\visual studio 2010\projects\html\html\html.cpp(34): error C2784: std::basic_string<_Elem> std::tr1::regex_replace(const std::basic_string<_Elem> &,const std::tr1::basic_regex<_Elem,_RxTraits> &,const std::basic_string<_Elem> &,std::tr1::regex_constants::match_flag_type): not able to output argument template for "const std::tr1::basic_regex<_Elem,wchar_t> &" from "const std::tr1::wregex"
          c:\program files\microsoft visual studio 10.0\vc\include\regex(2739): look to  typedef "std::tr1::regex_replace"

wcout抱歉,问题是什么?sry,我试图编译它,但它从“const std::tr1::wregex”返回了关于模板“const std::tr1::basic_regex&”的错误,所以问题是-如何使它工作,使用这些字符串,并正确显示结果,我已经尝试了regex_替换(line,wr,line2),没有-它会返回一些随机信息,如“00423DA4”,你能复制错误吗?只是简单地说一些关于它的一般性信息对你没有帮助。在问题中添加了em是的,我发现函数中的locale出现了一些语法错误,我用它来填充列表1,解决了这个问题。
ClCompile:
  html.cpp
c:\users\usr\documents\visual studio 2010\projects\html\html\html.cpp(34): error C2784: std::basic_string<_Elem> std::tr1::regex_replace(const std::basic_string<_Elem> &,const std::tr1::basic_regex<_Elem,_RxTraits> &,const std::basic_string<_Elem> &,std::tr1::regex_constants::match_flag_type): not able to output argument template "const std::tr1::basic_regex<_Elem,wchar_t> &" from "const std::tr1::wregex"
          c:\program files\microsoft visual studio 10.0\vc\include\regex(2739): look to typedef "std::tr1::regex_replace"
c:\users\usr\documents\visual studio 2010\projects\html\html\html.cpp(34): error C2784: std::basic_string<_Elem> std::tr1::regex_replace(const std::basic_string<_Elem> &,const std::tr1::basic_regex<_Elem,_RxTraits> &,const std::basic_string<_Elem> &,std::tr1::regex_constants::match_flag_type): not able to output argument template for "const std::tr1::basic_regex<_Elem,wchar_t> &" from "const std::tr1::wregex"
          c:\program files\microsoft visual studio 10.0\vc\include\regex(2739): look to  typedef of "std::tr1::regex_replace"
c:\users\usr\documents\visual studio 2010\projects\html\html\html.cpp(34): error C2784: std::basic_string<_Elem> std::tr1::regex_replace(const std::basic_string<_Elem> &,const std::tr1::basic_regex<_Elem,_RxTraits> &,const std::basic_string<_Elem> &,std::tr1::regex_constants::match_flag_type): not able to output argument template for "const std::tr1::basic_regex<_Elem,wchar_t> &" from "const std::tr1::wregex"
          c:\program files\microsoft visual studio 10.0\vc\include\regex(2739): look to  typedef "std::tr1::regex_replace"
wcout << regex_replace(line,wr,line2) << endl;