From: "Sandor Szücs" Date: 2008-08-26T18:15:54+09:00 Subject: Re: Still Query Continues On 26.08.2008, at 06:48, Newb Newb wrote: > > In this case the first one is valid image url because it has jpg > file > extensions.so i need to display the image urls which has the > .jpg,.png,gif extensions only.. > > Is this possible using Regular Expressions? yes. irb> a=%w{abc.jpg def ghi.png jkl.pngjpg mnp.bpng} => ["abc.jpg", "def", "ghi.png", "jkl.pngjpg", "mnp.bpng"] irb> a.select {|w| w.match(/\.(png|jpg)?$/)} => ["abc.jpg", "ghi.png"] > Pls Help me out To Understand If you want to understand more then you should read more documentation and wikipedia on your topic. Also test carefully your expressions by an irb session. Often it helps if you write a simple test to understand your problem. In my opinion a great ressource for regular expressions is http://www.regular-expressions.info Maybe the wikibook with the topic ruby will help you in the future: http://en.wikibooks.org/wiki/Ruby_Programming Please read the fine manuals in the web before writing forum entries. regards, Sandor Szücs --