From: Ralph Mason Date: 2001-10-30T17:55:41+09:00 Subject: [ruby-talk:23824] Re: Probably a simple one Thanks Joe, I can see how your expression works however I still mystified by the behavior of my one. If .* will just keep matching to the end of the line then my version should have returned nil as the whole expression would never have been matched. But it didn't I have just been playing with this z="abc" z=/(.*b)/ => 0 $1 => "ab" z=~/(.*)b/ => 0 $1 => "a" So it seems that .* is matching in this case until it finds the character following. But in the example below it doesn't. It seems to randomly stop. Can anyone clarify this? Thanks > > RM> s="xxx " > RM> s =~ /<.*A.*href *= *"(.*)".*>/ => 0 > $1 =>> "l.htm\">xxx > s = 'xxx ' > s =~ /\"\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 > >