首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

boost库正则表达式运行异常?

2012-03-14 
boost库正则表达式运行错误??我写了下面的测试代码,但是每次运行到boost::regex experssion的时候就报错,

boost库正则表达式运行错误??
我写了下面的测试代码,但是每次运行到boost::regex experssion的时候就报错,报的错误在下面,求大侠帮我看看什么原因,我用的是Boost_1_48,应该不是lib文件的事情吧。。。

C/C++ code
#include <cstdlib>#include <stdlib.h>#include <boost/regex.hpp>#include <string>#include <iostream>using namespace std;using namespace boost;int main(int argc, char* argv[]){    string epter="^select([a-zA-Z]*)from([a-zA-Z]*)";    [color=#FF0000]boost::regex expression(epter,boost::regex::icase);[/color]    std::string in;    cmatch what;    cout << "enter test string" << endl;    getline(cin,in);    if(regex_match(in.c_str(), what, expression))    {        for(int i=0;i<what.size();i++)            cout<<"str :"<<what.str()<<endl;    }    else    {        cout<<"Error Input"<<endl;    }    return 0;}

报错:A buffer overrun has occurred in Test_boost.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'.

[解决办法]
显然你的lib没做正确呗

热点排行