//============================================================================ // Name : Aksel.cpp // Author : Ivan Di Prima // Version : // Copyright : just use it if it is useful! // Description : Hello World in C, Ansi-style //============================================================================ #include #include #include "boost/xpressive/xpressive.hpp" using namespace std; /******************************************************************** * argv[1] = str * argv[2] = input file *********************************************************************/ int main(int argc, char* argv[]) { string line = "input a,b,gnd,s0,vddsafe; "; //const boost::xpressive::sregex rexports = boost::xpressive::sregex::compile ("^\\s*(input|output|inout)\\s+(.+)$"); const boost::xpressive::sregex rexports = boost::xpressive::sregex::compile ("^\\s*(input|output|inout)\\s+"); boost::xpressive::smatch what; if(boost::xpressive::regex_match(line, what, rexports)){ cout << "Match = " << what[1]; }else{ cout << "No Match\n"; } return EXIT_SUCCESS; }