title: Python 3 filtering directories by name that matches specific pattern
body: <p>Currently I'm developing script that will perform cleanup of specific directories.</p>
  
  <p>For example:
  Directory: /app/test/log
  contains many sub-directories with name pattern testYYYYMMDD and logYYYYMMDD</p>
  
  <p>What I need, is to filter out only directories like testYYYYMMDD</p>
  
  <p>To get all folders with absolute path that are in given directory I use:</p>
  
  <pre><code>folders_in_given_folder = [name for name in os.listdir(Directory) if os.path.isdir(os.path.join(Directory, name))]
  folder_list = []
  for folder in folders_in_given_folder:
      folder_list.append([os.path.join(Directory, folder)])
  print(folder_list)
  </code></pre>
  
  <p>Gives output:</p>
  
  <pre><code>[['/app/test/log/test20150615'], ['/app/test/log/test20150616'], ['/app/test/log/b'], ['/app/test/log/a'], ['/app/test/log/New folder'], ['/app/test/log/rem'], ['/app/test/log/test']]
  </code></pre>
  
  <p>So now I need to filter out sub-directories that fits pattern,
  pattern can be something like: *test*, test*, test2015*</p>
  
  <p>I've tried using glob.glob(), but this seems to work only with files not directories.</p>
  
  <p>Could someone please be so kind and explain how I could achieve desired outcome?</p>