So it only returns "temp.temp.com" or "temp.com". Essentially removing
the shortname of the host even if there is a range within the shortname.
I may have additional periods to identify subdomains but there will
never be a period inside a the shortname of the host.
So you want to remove everything up to the first period?
s = "host1.temp.temp.com"
s[/\..*/,1]
Jesus.
···
On Tue, Jan 15, 2013 at 10:26 PM, skolo pen <lists@ruby-forum.com> wrote:
Not versed in regex, hopefully someone can help me out.
How can I return only the domain from a string like
host[0-9].temp.temp.com
or
[0-9]host.temp.com
So it only returns "temp.temp.com" or "temp.com". Essentially removing
the shortname of the host even if there is a range within the shortname.
I may have additional periods to identify subdomains but there will
never be a period inside a the shortname of the host.