title: fnmatch- relating to matching a particular kind of filenames with numbers
body: <p>I am trying to list all the files in a directory which match <code>abc_def_[somenumber].json</code>. For example <code>abc_def_001.json</code> could be a file. </p>
  
  <pre><code>import os, re,fnmatch
  pattern = 'abc_def_*'
  for f in os.listdir('path of folder'):
     if fnmatch.fnmatch(f, pattern):
        print f
  </code></pre>
  
  <p>But this is not quite accurate as it spits out <code>"abc_def_comparison_001.json"</code>. I tried </p>
  
  <pre><code>pattern = 'abc_def_[0-9*]'
  </code></pre>
  
  <p>but that didn't quite work either. any ideas? </p>