title: Regex error: 'Warning: ereg() [function.ereg]: REG_ERANGE' in PHP
body: <p>The code below gives me this mysterious error, and i cannot fathom it. I am new to regular expressions and so am consequently stumped. The regular expression should be validating any international phone number.</p>
  
  <p>Any help would be much appreciated.</p>
  
  <pre><code>function validate_phone($phone)
  {
      $phoneregexp ="^(\+[1-9][0-9]*(\([0-9]*\)|-[0-9]*-))?[0]?[1-9][0-9\- ]*$";
  
      $phonevalid = 0;
  
      if (ereg($phoneregexp, $phone))
      {
          $phonevalid = 1;
      }else{
          $phonevalid = 0;
      }
  }
  </code></pre>