#include #include "boost/regex.hpp" int main(int argc, char* argv[]) { boost::wregex reg_ok( L".*\\.(?i:(docx|doc))" ); boost::wregex reg_bad( L".*\\.(?i:(doc|docx))" ); if ( !boost::regex_match( L"/data/txt/a.DOC", reg_ok ) ) printf( "#1 not matched!\n"); if ( !boost::regex_match( L"/data/txt/a.doc", reg_ok ) ) printf( "#2 not matched!\n"); if ( !boost::regex_match( L"/data/txt/a.DOCX", reg_ok ) ) printf( "#3 not matched!\n"); if ( !boost::regex_match( L"/data/txt/a.docx", reg_ok ) ) printf( "#4 not matched!\n"); if ( !boost::regex_match( L"/data/txt/a.DOC", reg_bad ) ) printf( "#5 not matched!\n"); if ( !boost::regex_match( L"/data/txt/a.doc", reg_bad ) ) printf( "#6 not matched!\n"); if ( !boost::regex_match( L"/data/txt/a.DOCX", reg_bad ) ) printf( "#7 not matched!\n"); if ( !boost::regex_match( L"/data/txt/a.docx", reg_bad ) ) printf( "#8 not matched!\n"); }