How would I create a filename filter in PHP similar to Subversion's global-ignores?
<p>I would like to build something to filter filenames in a fashion similar to SVN's <code>global-ignores format</code>. I am guessing it might be best to parse the string (below) and generate a regular expression for it, but I am not sure if there is a better way to do this or if it has already been implemented somewhere.</p>

<pre><code>*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ #*# .#* .*.swp .DS_Store
</code></pre>

<p>Alternate suggestions would be appreciated!</p>
