From: Damjan Rems Date: 2008-08-27T22:02:19+09:00 Subject: Re: Regular Expressions Newb Newb wrote: >> >> # url = " >> http://www.ingolfwetrust.com/golf-central/content/binary/Davis-Love-III.jpg" >> filename = url.scan(/[^\/]+/).last >> >> This looks for all sections of the string that do not contain a slash >> and >> picks the last one. > > > Thanks for the reply..it works but my url is like this > > ="http://www.ingolfwetrust.com/golf-central/content/binary/Davis-Love-III.jpg"> > - ="http://www.ingolfwetrust.com/golf-central/aggbug.ashx?id=56f9e33a-6333-4daf-b4e1-137ddc051adf"> > > so it gives me only this > > aggbug.ashx?id=56f9e33a-6333-4daf-b4e1-137ddc051adf"> > > > Pls Help me on this Althow it is not the most genius one ;-) url.split("/").last.gsub(/"|>/,'') by TheR -- Posted via http://www.ruby-forum.com/.