title: File name matching with fnmatch
body: <p>I have a directory with files with the format: <code>LnLnnnnLnnn.txt</code></p>
  
  <p>where L = letters and n = numbers. E.g: <code>p2c0789c001.txt</code></p>
  
  <p>I would like to separate these files based on whether the second number (i.e. 0789) is within a certain sequence of numbers (e.g. 0001 to 0146).</p>
  
  <p>Is there an easy way to do this with fnmatch? Or should I be using regex?</p>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>out_files = []
  for root, dirs, filenames in os.walk('.'):
     for filename in fnmatch.filter(filenames, '???[0-9][0-9][0-9][0-9]????*.txt'):
         out_files.append(os.path.join(root, filename))
  </code></pre>