Given the URL (single line): http://test.example.com/dir/subdir/file.html
How can I extract the following parts using regular expressions:
Java offers a URL class that will do this. Query URL Objects.
On a side note, PHP offers parse_url().