LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-06-2010, 05:00 AM   #1
cnsung
LQ Newbie
 
Registered: Mar 2008
Posts: 3

Rep: Reputation: 0
c++ boost on Linux : \w can't match Chinese/Japanese character


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 ?
 
  


Reply

Tags
boost, c++, linux



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
display japanese,korean,chinese,english data on linux kapilmaheshwari20 Red Hat 2 01-13-2008 03:01 AM
chinese/Japanese input via SCIM in ubuntu 6.10 leong3779 Linux - Desktop 13 05-14-2007 03:28 AM
Key in Chinese/Japanese words WindowsKiller SUSE / openSUSE 1 11-08-2005 07:50 PM
Chinese or Japanese? BigDawg General 19 06-29-2005 06:55 PM
chinese/japanese mozilla STE001 Linux - General 2 02-21-2004 01:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration