title: python regex os path
body: <p>I am trying to find directories that follow the below pattern and any instances of mbojava that reside within:</p>
  
  <p>/v/mybooks.com/<strong><em>somethign that keeps changing</em></strong>/mbo(with or without a proceeding 'c[1-9]')/</p>
  
  <p>I also wish to avoid names that follow with a dot, eg mbo not mbo.prev mboc3 not mboc3.broken,etc</p>
  
  <p>I have the following so far: </p>
  
  <pre><code>regex = re.compile("\/mbo(c[1-9])?\/"
  mbojava = False
  for root, dirs, names in os.walk("/v/mybooks.com/"):
     if 'mbojava' in names and regex.search(root):
        mbojava =  os.path.join(root, 'mbojava')
        print mbojava
  </code></pre>
  
  <p>Result: </p>
  
  <p>I only get one line  when I know for certain that there are multiple directories that follow the above pattern.</p>