From: Joseph McDonald Date: 2001-10-30T17:19:44+09:00 Subject: [ruby-talk:23821] Re: Probably a simple one RM> I am trying to extract the href from links in HTML, however the RM> regular expression matcher doesn't appear to stop in the correct RM> place. RM> I intend the regular expression to extrace the href that is RM> enclosed in quotes and return that into $1. However is seems to RM> 'miss' the first set of quotes and a following one and finally RM> stop on a third set. RM> Here is an example RM> s="xxx " RM> s =~ /<.*A.*href *= *"(.*)".*>/ => 0 $1 =>> "l.htm\">xxx \"\s]+).*/i p $1 the above gets everything between the href= and the > (excluding the ending space or quote if there). Is that what you were looking for? regards, -joe