From: spiralofhope Date: 2011-10-08T04:44:42+09:00 Subject: Re: regex an array? On Sat, 8 Oct 2011 03:59:50 +0900 skolo pen wrote: > I am having troubles trying to regex the following array to only > include the last word > > ["user created TI: TI-0001"] > > I am trying to regex or gsub so only TI-0001 returns. > Is that opening string "user created TI: " the same every time? Is 'TI-0001' the same length of data, every time? If yes, then why a regex? What about something simple like this: a = [ "user created TI: TI-0001" ] b = a[0][ -7..-1 ] -- http://spiralofhope.com