Forum: Ruby Regular Expression interesting problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
19eb75164135659a8fae98101b1c250e?d=identicon&s=25 Arun Kumar (arun_nss)
on 2009-03-28 10:47
Hi,
At present I'm learning about regular expressions in order to do an html
scraping assignment. Everything worked fine until I met with a problem.
Given below are two different html tags

<link rel="alternate" type="application/rss+xml" title="RSS 2.0"
href="http://www.shoe-g.com/index.xml" />

<link
href="http://newsrss.bbc.co.uk/rss/newsonline_world_edit...
rel="alternate" type="application/rss+xml" title="BBC NEWS | Help | RSS"
/>

Now what i want is to capture the url inside 'href' if
type="application/rss+xml". It really seems to be simple but it is the
position of the 'type' that creates the problem. In the first tag the
type is before href and in the second the type is after href. It seems
to me as an interesting problem but i need help to solve that. Please
help me.

Regards
Arun Kumar
This topic is locked and can not be replied to.