From: "Jesús Gabriel y Galán" Date: 2013-01-16T17:01:23+09:00 Subject: Re: regex hostnames? On Wed, Jan 16, 2013 at 12:20 AM, Joel Pearson wrote: >> >> s = "host1.temp.temp.com" >> s[/\..*/,1] Oops, copy/paste error, I forgot the parens. This was my meant solution: 1.9.2p290 :003 > s[/\.(.*)/,1] => "temp.temp.com" > Shouldn't that be s[/\..*/,0] or s[/\..*/] ? These ones return also the first ".": 1.9.2p290 :004 > s[/\..*/,0] => ".temp.temp.com" 1.9.2p290 :005 > s[/\..*/] => ".temp.temp.com" Jesus.