Ticket #9451: regex.cxx
File regex.cxx, 386 bytes (added by , 9 years ago) |
---|
Line | |
---|---|
1 | #include <string> |
2 | #include <boost/regex.hpp> |
3 | #include <boost/locale.hpp> |
4 | |
5 | int main(int, char **) |
6 | { |
7 | std::locale::global(boost::locale::generator().generate("")); |
8 | boost::regex test; |
9 | test.imbue(std::locale()); |
10 | test.assign("^([^:]*)(:([0-9]+))?$"); |
11 | boost::smatch captures; |
12 | auto result = boost::regex_match(std::string("0.0.0.0:20579"), captures, test); |
13 | assert(result); |
14 | return 0; |
15 | } |
16 |