65,189
社区成员




#include <boost/regex.hpp>
#include <string>
#include <iostream>
int main()
{
using namespace std;
string result,to_be_search;
string regexpress =
"\d{4}[-/.年])?\d{1,2}[-/.月]\d{1,2}日?(\s*(?:[01][0-9]|2[0-3])(?::[0-5][0-9]){1,2})?";
boost::regex reg(regexpress, boost::regex::icase/**//*不分大小写*/);
if (boost::regex_search(to_be_search, what, reg)) {
result = what.str(*);
cout << "结果: << result << endl;
}
return 0;
}