From: Christian von Kleist Date: 2007-11-28T02:00:38+09:00 Subject: Re: regex problem On Nov 27, 2007 11:28 AM, K. R. wrote: > hi @all > > I would like to scan a string of html-tags. I need it to take out all > links (a-tags) in the string, but I become only the last one. What is > wrong? See the code below... > > response = 'test1 - href="hello2.html">test2' > response.scan(/ puts line > end > > thanks for helping! > -- > Posted via http://www.ruby-forum.com/. > > Franco is right. You could fix it by doing "a.*?href". However, I would change "a.*href" to "a\s+href" since you're looking for any amount of whitespace after the "a" and before the "href". response = 'test1 - test2' response.scan(/