#include "stdafx.h" #include <cstdlib> #include <stdlib.h> #include <boost/regex.hpp> #include <string> #include <iostream> using namespace std; using namespace boost; regex expression("^select ([a-zA-Z]*) from ([a-zA-Z]*)"); int main(int argc, char* argv[]) { std::string in; cmatch what; cout << "enter test string" << endl; getline(cin,in); if(regex_match(in.c_str(), what, expression)) { for(int i=0;i<what.size();i++) cout<<"str :"<<what[i].str()<<endl; } else { cout<<"Error Input"<<endl; } return 0; } |
欢迎访问最专业的网吧论坛,无盘论坛,网吧经营,网咖管理,网吧专业论坛
https://bbs.txwb.com
关注天下网吧微信/下载天下网吧APP/天下网吧小程序,一起来超精彩
|
本文来源:vczx 作者:佚名