Created
November 25, 2011 12:39
-
-
Save chezou/1393431 to your computer and use it in GitHub Desktop.
Sample of re2 libirary in Japanese
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compile g++ -Wall re2test.cpp -o re2.out -lre2 -lpthread | |
#include <iostream> | |
#include <string> | |
#include <re2/re2.h> | |
#include <cassert> | |
using namespace std; | |
int main(int argc, char **argv){ | |
string s,t; | |
string str("あぶらかたぶら"); | |
RE2 re1("(.ら).(.ぶ)"); | |
assert(re1.ok()); | |
if(RE2::PartialMatch(str, re1 , &s, &t)) | |
cout << "s:"<< s << " t:"<< t << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment