11 Jan
2004
11 Jan
'04
6:19 p.m.
I'm new to regex and would like to use it to match filenames, but I'd like to stick with a csh/bash syntax. Is this advisable? If so, would anyone have a set of regex traits for this syntax? If not, could someone point me in the right direction? Thanks, --rich An sample usage is: namespace fs = boost::filesystem char * dirname; /*...glob_regex_traits definition */ boost::regex expr( "*.cpp" , /*...glob_regex_traits...*/ ); for( fs::directory_iterator iter( fs:path( dirname ) ) ; iter != fs::directory_iterator() ; ++iter ) { boost::cmatch match_data if( regex_match( iter->leaf().c_str(), match_data, expr ) ) { /*...do something...*/ } }