Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glob style regex pattern match using boost

I need to search for files which match some pattern which is similar to the pattern which is given on the command line in glob style using boost.

For example:
If the input is myFiles*.c it should match the files myFiles.c , myFiles1.c, myFiles123.c etc..

Tried using the boost::regex_match with the perl mode. But I had to give the input pattern as myfiles.*.c instead of myFiles*.c. I can recognise myfiles*.c and translate it to myFiles.*.c and give it to the boost::regex_match in perl mode. But the input pattern could be any vaild regex in the glob style as it is given for the command line utilities.

Is there any way in boost so that the pattern is interpreted in the glob style ?

I haven't used boost before.
Any help ? Thanks.

like image 481
user3144089 Avatar asked Oct 21 '22 17:10

user3144089


1 Answers

You could try my glob_match. It's not Boost but it is C++.

like image 167
Waxrat Avatar answered Oct 24 '22 10:10

Waxrat