Ticket #5852: Aksel.cpp

File Aksel.cpp, 1.1 KB (added by anonymous, 11 years ago)
Line 
1//============================================================================
2// Name : Aksel.cpp
3// Author : Ivan Di Prima
4// Version :
5// Copyright : just use it if it is useful!
6// Description : Hello World in C, Ansi-style
7//============================================================================
8#include <iostream>
9#include <string>
10
11#include "boost/xpressive/xpressive.hpp"
12
13using namespace std;
14
15
16/********************************************************************
17* argv[1] = str
18* argv[2] = input file
19*********************************************************************/
20int main(int argc, char* argv[])
21{
22string line = "input a,b,gnd,s0,vddsafe; ";
23//const boost::xpressive::sregex rexports = boost::xpressive::sregex::compile ("^\\s*(input|output|inout)\\s+(.+)$");
24const boost::xpressive::sregex rexports = boost::xpressive::sregex::compile ("^\\s*(input|output|inout)\\s+");
25boost::xpressive::smatch what;
26
27 if(boost::xpressive::regex_match(line, what, rexports)){
28 cout << "Match = " << what[1];
29 }else{
30 cout << "No Match\n";
31 }
32
33 return EXIT_SUCCESS;
34}
35
36