globbing with regex??
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...*/ } }
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?
Unfortunately that's not supported in Boost.regex at present - it's definitely on my TODO list though. John.
participants (2)
-
John Maddock
-
Rich Johnson