title: Valid url check form validation in codeigniter
body: <p>Here is code I have for a url validation function in CI, and this is the callback function      </p>
  
  <pre><code>function valid_url($facebook)
      {
          $pattern = "/^((ht|f)tp(s?)\:\/\/|~/|/)?([w]{2}([\w\-]+\.)+([\w]{2,5}))(:[\d]{1,5})?/";
          if (!preg_match($pattern, $facebook))
          {
              return FALSE;
          }
  
          return TRUE;
      }     
  </code></pre>
  
  <p>I'm getting this error </p>
  
  <pre><code>Message: preg_match() [function.preg-match]: Unknown modifier '|'
  </code></pre>