From: Milan Dobrota Date: 2009-03-14T21:52:12+09:00 Subject: Re: regular expression / gsub question 7stud -- wrote: > Milan Dobrota wrote: >> You can also do a filename.split(/_/)[1] >> >> which is probably not that >> efficient but you can get all three parts of the string. > > Do you mean "not that efficient" in the sense that ruby programs are > ponderously slow and that isn't? I still believe that filename[/\Auserfilename\d*_(scriptname\d*)_\d+\.txt\z/, 1] is the most efficient way of doing that. I just provide this as another option. -- Posted via http://www.ruby-forum.com/.