Hi,
I wanna match Chinese character via \w(boost regex) on linux. but it didn't work , the c++ code as below
Code:
#include<boost/regex.hpp>
#include <iostream>
#include <stdio.h>
using namespace std;
using namespace boost;
int main(int argc, char* argv[])
{
FILE* fp;
fp=fopen(argv[1],"r");
fseek(fp,0,SEEK_END);
long filesize = ftell(fp);
fseek(fp,0,SEEK_SET);
//printf("filesize=%d\n",filesize);
fflush(stdout);
char* buf=new char[filesize];
fread(buf,1,filesize,fp);
fclose(fp);
//printf(buf);
static const boost::regex e(argv[2], boost::regex::perl);
if(boost::regex_search(buf,buf+filesize, e))
std::cout << "match \n";
else
std::cout << "not match \n";
}
the boost version is :1.42.0
any ideas ?