title: How can I create a regex from a list of words?
body: <p>I have a dict of words (actually I have nested dicts of verb conjugations, but that isn't relevant) and I want to make a regex by combining them.</p>
  
  <pre><code>{
    'yo': 'hablaba',
    'tú': 'hablabas',
    'él': 'hablaba',
    'nosotros': 'hablábamos',
    'vosotros': 'hablabais',
    'ellos': 'hablaban',
    'vos': 'hablabas',
  }
  </code></pre>
  
  <p>... to make:</p>
  
  <pre><code>'habl((aba(s|is|n)?)|ábamos)' # I think that's right
  </code></pre>
  
  <p>If I don't include <code>'hablábamos'</code> it's easy - they're all the same prefix, and I can get:</p>
  
  <pre><code>'hablaba(s|is|n)?'
  </code></pre>
  
  <p>... but I want a general form. Is that possible?</p>