title: ereg/eregi replacement for PHP 5.3
body: <p>I'm sorry to ask a question but I am useless when it comes to understanding regex code.</p>
  
  <p>In a php module that I didn't write is the following function</p>
  
  <pre><code>function isURL($url = NULL) {
      if($url==NULL) return false;
  
      $protocol = '(http://|https://)';
      $allowed = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)';
  
      $regex = "^". $protocol . // must include the protocol
                       '(' . $allowed . '{1,63}\.)+'. // 1 or several sub domains with a max of 63 chars
                       '[a-z]' . '{2,6}'; // followed by a TLD
      if(eregi($regex, $url)==true) return true;
      else return false;
  }
  </code></pre>
  
  <p>Can some kind soul give me the replacement code for that with whatever is required to replace the eregi</p>