boost库链接
我想用boost库中的正则表达式,我用的是最网上那个最经典的例子,代码如下,为什么build的时候出现如下错误提示:
error C2018: unknown character '0xa1',请问下是为什么?
#include "stdafx.h"
#include <cstdlib>
#include <stdlib.h>
#include <boost/regex.hpp>
#include <string>
#include <iostream>
using namespace std;
using namespace boost;
regex expression("^select ([a-zA-Z]*) from ([a-zA-Z]*)");
int main(int argc, char* argv[])
{
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[i].str()<<endl;
}
else
{
cout<<"Error Input"<<endl;
}
return 0;
}