I need to unzip all the files in the directory, and for this I need to find the first file in the set. I am currently doing this using a bunch of if statements and loops. Can I do this with regex?
Here is the list of files that I need to map:
yes.rar
yes.part1.rar
yes.part01.rar
yes.part001.rar
yes.r01
yes.r001
They should NOT be matched:
no.part2.rar
no.part02.rar
no.part002.rar
no.part011.rar
no.r002
no.r02
I found a similar regex in this thread, but it seems that Python does not support variable length scans. A single-line regex will be complicated, but I am documenting it well and that is not a problem. This is just one of those problems that you beat your heap, more.
Thanks in advance guys.
:)