title: expanding regex in Python
body: <p>My program takes in a regex for describing a set of devices. For example, </p>
  
  <pre><code>--device=dev{01,02}{nyc}.hukka.com 
  </code></pre>
  
  <p>should expand to dev01nyc.hukka.com and dev02nyc.hukka.com</p>
  
  <p>How can I use the <code>re</code> module in Python to expand the user provided regex to complete strings that I can use? I am using Python 2.4.</p>