From: "Artūras Šlajus" Date: 2009-01-28T04:59:53+09:00 Subject: Re: A bug in Ruby regexp lib? Tim Greer wrote: > Note the \1 is using (^|\s), as it's either the start of the string (^) > or a white space between the two URLs (\s), but you also have \3, which > is either the end of the string ($) or white space between the URLs (or > following) (\s), and since there's only one white space between the two > URLs, it throws is off. > > To account for both \1 and \3, above I've set it to be optional (^|\s)? > because this will allow you to use \3 without is breaking it. There > are other ways to do this, but just working with what you were using, > that's a change you could make to get the desired results on the first > one... unless I misunderstood what you were trying to do? Ah, thank you. It seems that Ruby is parsing that string after getting last \s down there. But shouldn't \3 insert it right back? :) Anyways, I have another problem then ;] it "should link http links" do "http://www.myspace.com/djmamania".htmlize.should == \ '

www.myspace.com/djmamania

' end 2) 'String#htmlize should link http links' FAILED expected: "

www.myspace.com/djmam ania

", got: "

http://www.myspace.com/djmamania

" (using ==) What do you suggest? -- Posted via http://www.ruby-forum.com/.