How can I get only the domain name from the frontend browser

Here's another solution I just posted:

MACRO: Extract Domain from URL [Example]

Please feel free to test it against your hardest, toughest, URL cases.
If you find any problems, please in the above Macro topic.