Parsing all elements of URL addresses

Q

How to parse out all elements from URL addresses with a regular expression?

Here are URL address examples:

✍: Guest

A

URL addresses are written in this format:

scheme://domain:port/path?query_string#fragment_id

The regular expression to parse all elements from URL addresses can be written as: with the multiple lines modifier "m" specified:

Click the button to test this regular expression here online:

2013-02-03, 0👍, 0💬