boost正则表达式匹配一次

 #include "stdafx.h"
#include
#include
#include
#include
#include

using namespace std;
using namespace boost;

regex expression("^select ([a-zA-Z]*) from ([a-zA-Z]*)");

int main(int argc, char* argv[])
{
    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 < ( int ) what.size();i++)
            cout<<"str :"<     }
    else
    {
        cout<<"Error Input"<     }
    system( "pause" );
    return 0;
}

你可能感兴趣的:(boost正则表达式匹配一次)