From: Stefan Rusterholz Date: 2007-07-19T22:26:02+09:00 Subject: Re: What's going on here with gsub? Peter Bailey wrote: > Hi, > I'm baffled by this problem. If I define a single file, I can use gsub > to create the same name, with different extensions. But, when I do it > with a list of files, it doesn't work. Why is the code below giving me > nothing but .tif files, when, I'm asking for three different file types: > tif, png, and pdf? > > Thanks, > Peter "TIF" and "tif" is not the same. You probably want the //i switch which makes regexen case insensitive. Also I suggest you anchor your regexp, else you might have unwanted results. E.g. gsub(/\.tif\z/i, ...) Regards Stefan -- Posted via http://www.ruby-forum.com/.