title: Variable inside regular expression php
body: <p>I a stuck with regular expression and i need help.
  So basically i want to do somethning like this:
      
  
  <pre><code>$data = "hi";
  $number = 4;
  
  $reg = '/^[a-z"]{1,4}$/';
  
  
  if(preg_match($reg,$data)) {
      echo 'Match';   
  }else {
      echo 'No match';
  }
  </code></pre>
  
  <p>But i want to use variable</p>
  
  <pre><code>$reg = '/^[a-z"]{1, variable here }$/';
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>$reg = '/^[a-z"]{1, '. $number .'}$/';
  
  $reg = "/^[a-z\"]{1, $number}$/";
  </code></pre>
  
  <p>But not getting right result.</p>
  
  <p>Tnx for help</p>