Best Practices when matching large number of files against large number of regex strings
<p>I have a directory with several thousand files. I want to sort them into directories based on file name, but many of the file names are very similar. </p>

<p>my thinking is that i'm going to have to write up a bunch of regex strings, and then do some sort of looping. this is my question:</p>

<p>is one of these two options more optimal than the other? do i loop over all my files, and for each file check it against my regexs, keeping track of how many match? or do i do the opposite and loop over the regex and touch each file? </p>

<p>i had though to do it in python, as thats my strongest language, but i'm open to other ideas. </p>
