title: Regular expression for validating a url
body: <p>I'm a beginner in regexes. My requirement is to validate simple urls to urls with query strings, square brackets etc.. say for eg,</p>
  
  <p>www.test.com?waa=[sample data] </p>
  
  <p>the regex that I wrote only work for simple urls. It fails for the one with square brackets. Any idea?</p>