Any help is certainly appreciated. Thanks.
Remember that if the expression matches a non-quoted string then the bit you want is actually in $2 not $1, here's what I came up with: boost::regex exp( "\"((?:[^\\\\\"]|\\\\.)+)\"[:space:]*" "|" "([^[:space:]]+)[:space:]*" ); std::string str = "parm1 \"parm2 parm3\" \"parm4 \\\"yo\\\"\""; std::string::const_iterator start = str.begin(), end = str.end(); boost::match_resultsstd::string::const_iterator what; unsigned int flags = boost::match_default; while (boost::regex_search(start, end, what, exp, flags)) { std::string spec(what[0]); std::string match; if(what[1].matched) match = what[1]; // quoted string else match = what[2]; // non-quoted string start = what[0].second; std::cout << spec << std::endl; std::cout << match << std::endl << std::endl; } which prints: parm1 parm1 "parm2 parm3" parm2 parm3 "parm4 \"yo\"" parm4 \"yo\" which looks like what you want? John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm