I have file names that are in this format:
anytext_NUMBER_svm.pkl
I need to loop thourgh all files in a dir and file files that look like this:
file1.txt
file2.txt
anytext_1_svm.pkl
anytext_2_svm.pkl
anytext_3_svm.pkl
The matched files will be this:
anytext_1_svm.pkl
anytext_2_svm.pkl
anytext_3_svm.pkl
How to I use python regex to do this?
This regex shoud solve your problems:
But you should definitely take a look at the documentation: http://docs.python.org/library/re.html