id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 3458,Xpressive Library - sub_match does not work on some occasions,Eric Schwarz ,Eric Niebler,"Decoding a time and date string. Dealing with dynamic regexes. Code does compile but suspicious output when executed. Regex does match, but submatches aren't like expected partially. Actually all string compares should return ""0"" but don't. For those which don't for me a ""cout"" of the submatch string was added. #include #include #include using namespace std; using namespace boost; using namespace boost::xpressive; int main() { ///////////////////////////////////////////// // Decode date and time // 2009/09/14 05:30 // sregex rex = sregex::compile( ""^(\\d{4})/(\\d{2})/(\\d{2})(\\s)(\\d{2})([:])(\\d{2})"" ); smatch what; if( regex_match( string(""2009/09/14 05:30""), what, rex ) ) { cout << ""TAF file was generated on "" << what.size() << endl; cout << what[0].str().compare( string( ""2009/09/14 05:30"" ) ) << endl; cout << what[1].str().compare( string( ""2009"" ) ) << endl; cout << what[2].str().compare( string( ""09"" ) ) << endl; cout << what[3].str().compare( string( ""14"" ) ) << endl; cout << what[3].str() << endl; cout << what[4].str().compare( string( "" "" ) ) << endl; cout << what[4].str() << endl; cout << what[5].str().compare( string( ""05"" ) ) << endl; cout << what[5].str() << endl; cout << what[6].str().compare( string( "":"" ) ) << endl; cout << what[7].str().compare( string( ""30"" ) ) << endl; } return 0; }",Bugs,closed,Boost 1.41.0,xpressive,Boost 1.40.0,Problem,invalid,xpressive sub_match,