How to pattern match a domain name

I am wondering if its possible to use pattern matching in elixir to get the domain name of a website.
For instance:
so Domainname might be, “google” or “amazon”

I think it’s not that easy given the various changing list of top-level domains. I’d look around for a package to handle that.


yeah is your friend… searching for domain or tld yields:
domainatrex | Hex which I believe does the job for you;-)

1 Like