title: Regex for HTTP URL with Basic authentication
body: <p>In my application, I must read a URL and do something if the URL contains Basic authentication credentials. An example of such a URL is </p>
  
  <p><a href="http://username:password@example.com" rel="nofollow">http://username:password@example.com</a></p>
  
  <p>Is the regular expression below a good fit for my task? I am to capture four groups into local variables. The URL is passed to another internal library that will do further work to ensure the URL is valid before opening a connection.</p>
  
  <pre><code>^(.+?//)(.+?):(.+?)@(.+)$
  </code></pre>