title: Could you share a link to an URL parsing implementation?
body: <p>As far as I understand, an URL consists of the folowing fields:</p>
  
  <ul>
  <li>Protocol (http, https, ftp, etc.)</li>
  <li>User name</li>
  <li>User Password</li>
  <li>Host address (an IP address or a DNS FQDN)</li>
  <li>Port (which can be implied)</li>
  <li>Path to a document inside the server documents root</li>
  <li>Set of arguments and values</li>
  <li>Document part (#)</li>
  </ul>
  
  <p>as</p>
  
  <pre>protocol://user:password@host:port/path/document?arg1=val1&arg2=val2#part</pre>
  
  <p>I need a code to get value (or null/empty value if not set) of any of these fields from any given URL string. Am I to implement this myself or there is already a code for this so I don't need to invent a wheel?</p>
  
  <p>I am particularly interested in Scala or Java code. C#, PHP, Python or Perl code can also be useful.</p>