From: Robert Klemme Date: 2009-05-06T20:53:34+09:00 Subject: Re: Ruby Regex 2009/5/6 Srijayanth Sridhar : > He only wanted the first occurrence of zip I think. Ah, yes. I overlooked that. Sorry for the noise. IMHO an anchor is in order: irb(main):001:0> "d:\\home\\abc2.zip\\abc.zip\\abc.com"[/\A.*?\.zip/] => "d:\\home\\abc2.zip" Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/