title: Using variables in re.findall() regex function
body: <p>I have a list of regex patterns like <em>k[a-z]p[a-z]+a</em> 
  and a list of words that can fit into these patterns. Now, the problem is that,
  when I use: </p>
  
  <pre><code>re.findall(r'k[a-z]p[a-z]+a', list)
  </code></pre>
  
  <p>Everything works properly, but when I replace the raw expression with a variable like:</p>
  
  <pre><code>pattern = "r'" + pattern + "'"
  </code></pre>
  
  <p>and then try:</p>
  
  <pre><code>re.findall(pattern, list)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>re.findall(str(pattern), list)
  </code></pre>
  
  <p>It no longer works. How could I fix it? </p>
  
  <p>Thanks!
  Spike </p>