I am trying to construct a regex to extract a domain given a url.
for:
http://www.abc.google.com/ http://abc.google.com/ https://www.abc.google.com/
Don't know much about ruby but this regex pattern gives you the last 3 parts of the url excluding the trailing slash with a minumum of 2 characters per part.
([\w-]{2,}\.[\w-]{2,}\.[\w-]{2,})/$