title: Regular expression for validating url with parameters
body: <p>I have been searching high and low for a solution to this, but to no avail. I am trying to prevent users from entering poorly formed URLs. Currently I have this regular expression in place:</p>
  
  <pre><code>^(http|https)\://.*$
  </code></pre>
  
  <p>This does a check to make sure the user is using <em>http</em> or <em>https</em> in the URL. However I need to go a step further and validate the structure of the URL.</p>
  
  <p>For example this URL: <code>http://mytest.com/?=test</code> is clearly invalid as the parameter is not specified. All of the regular expressions that I've found on the web return valid when I use this URL.</p>
  
  <p>I've been using <a href="http://www.regular-expressions.info/javascriptexample.html" rel="nofollow">this</a> site to test the expressions that I've been finding. </p>