#include "stdafx.h"
#include <cstdlib>
#include <stdlib.h>
#include <boost/regex.hpp>
#include <string>
#include <iostream>

using namespace std;
using namespace boost;

regex reg("a(\\d*)b");

int main(int argc, char* argv[])
{
    string in;
    cmatch what;
    cout << "enter test string" << endl;
    getline(cin,in);
    sregex_token_iterator it( in.begin(), in.end(), reg, 1 );
    sregex_token_iterator end;

    while ( it != end )
    {
        cout << ( *it++ ) << endl;
    }

    system( "pause" );
    return 0;
}

相关文章:

猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
相关资源
相似解决方案