title: Converting php regexp to javascript regexp
body: <p>I need some help converting this PHP regular expression to a Javascript one though I am not very familiar to regular expressions:</p>
  
  <pre><code>$regex = "((https?|ftp)\:\/\/)?"; // SCHEME
  $regex .= "([a-z0-9+!*(),;?&amp;=\$_.-]+(\:[a-z0-9+!*(),;?&amp;=\$_.-]+)?@)?"; // User and Pass
  $regex .= "([a-z0-9-.]*)\.([a-z]{2,3})"; // Host or IP
  $regex .= "(\:[0-9]{2,5})?"; // Port
  $regex .= "(\/([a-z0-9+\$_-]\.?)+)*\/?"; // Path
  $regex .= "(\?[a-z+&amp;\$_.-][a-z0-9;:@&amp;%=+\/\$_.-]*)?"; // GET Query
  $regex .= "(#[a-z_.-][a-z0-9+\$_.-]*)?"; // Anchor
  </code></pre>