From: Ammar Ali Date: 2010-11-24T00:36:02+09:00 Subject: Re: Regex negative look-behind bug? --001636c5a6032828080495ba200b Content-Type: text/plain; charset=UTF-8 On Tue, Nov 23, 2010 at 4:36 PM, Ruby Nuby wrote: > irb, Ruby 1.9.1 > > What am I missing here? > > "b T T W b".match(/(? => nil > > #The second look-behind is now just a > "b T T W b".match(/(? => # > > #Regex stays the same, the T T are now in lower case > "b t t W b".match(/(? => nil > > #Look-behind only contains the t t condition now and, T T are back to > upper case > "b T T W b".match(/(? => nil > > No bug here. It is doing exactly what you asked: only match a w if it is not preceded by 't t'. In all cases the w is preceded by 't t', and in the case that did match (?> "b Y T W b".match( /(? # Regards, Ammar --001636c5a6032828080495ba200b--