C++ Boost正则表达式中的等号

C++ Boost正则表达式中的等号,c++,regex,boost,C++,Regex,Boost,我对下面的Boost正则表达式有一个问题 boost::regex e("="); if(regex_search("=", e)) cout << "yeah"; boost::regex e(“=”); 如果(regex_search(“=”,e))不能使用相同的代码,我确实会在这里得到“yeah” 请注意,我必须在regex_search的开头添加boost::,并且我在Linux下的GCC上运行。我还没有在Windows下安装Boost 1.37,因此我无法在那里轻松测试它

我对下面的Boost正则表达式有一个问题

boost::regex e("=");
if(regex_search("=", e)) cout << "yeah";
boost::regex e(“=”);
如果(regex_search(“=”,e))不能使用相同的代码,我确实会在这里得到“yeah”


请注意,我必须在
regex_search
的开头添加
boost::
,并且我在Linux下的GCC上运行。我还没有在Windows下安装Boost 1.37,因此我无法在那里轻松测试它。

我刚刚在Visual Studio 2008上用Boost 1.37尝试了您提供的代码,它编译、运行并输出“是的”。您确定正确设置了Boost吗?

是的。对我来说也一样,我也有同样的设置。