title: Using python's RegEx {m,n} operation, but using variables for m and n
body: <p>I want to specificy a global min and max variable to use in a regular expression checking ID validity.</p>
  
  <p>For example, set variables </p>
  
  <pre><code>min=8 
  max=16
  alphanumeric input
  </code></pre>
  
  <p>Then the expression I want Python to interpret is </p>
  
  <pre><code>r'\w{8,16}\Z'
  </code></pre>
  
  <p>but I want to use the variables min and max rather than hardcoding the numbers into the expression.</p>