Capturing domain name from URL


How to capture scheme name from URL addresses with a regular expression?

Here are URL address examples:

✍: Guest


URL addresses are written in this format:


The regular expression to capture the domain name 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, 2231👍, 0💬