From: Sean O'Halpin Date: 2009-03-28T22:06:25+09:00 Subject: Re: Regular Expression interesting problem On Sat, Mar 28, 2009 at 11:44 AM, Arun Kumar wrote: > Hi, > You have completely misunderstood me. I'm working as a software engineer > trainee right now. The first problem that i had has been solved. Now it > is a new assignment. To tell frankly. I have just 2 weeks of experience > in ruby and there is nobody right here that have knwledge about ruby. > That is why i'm asking a favour through this community. I'm sorry if i'm > troubling u guys so much. If I have misrepresented you, then you have my sincerest apologies. However, you have not really represented your own position terribly well. Now that we know you are a trainee with little experience who is currently specifically being trained in regular expressions, it makes more sense that you cannot use REXML, etc. But this was not clear from your previous posts. By the way, you are more likely to get a positive response if you at least show how far you have got with the problem yourself before coming to the list. And to make up for my grouchy mood this morning, here's my contribution: hashes = [] data.scan(/]+?>/) do |link| hashes << Hash[*link.scan(/([a-z]+)=["']?([^"]+)["']?/).flatten] end require 'pp' pp hashes.select{ |hash| hash["type"] == "application/rss+xml" } But I have no idea if this will meet the requirements of your assignment or if you will understand it. Regards, Sean