Ticket #31525: sample.cpp
File sample.cpp, 423 bytes (added by takanori@…, 13 years ago) |
---|
Line | |
---|---|
1 | #include <iostream> |
2 | #include <boost/regex.hpp> |
3 | #include <boost/regex/icu.hpp> |
4 | |
5 | using namespace std; |
6 | using namespace boost; |
7 | |
8 | int main(void) { |
9 | const char *s = "なにか書く"; |
10 | u32regex rx(make_u32regex("(に)(.)(.)")); |
11 | cmatch r; |
12 | if (u32regex_search(s, r, rx)) { |
13 | cout << r.prefix() << endl; |
14 | for (int i=1; i<r.size(); ++i) { |
15 | cout << r[i] << endl; |
16 | } |
17 | cout << r.suffix() << endl; |
18 | } |
19 | return 0; |
20 | } |