From: hemant Date: 2006-12-05T13:56:21+09:00 Subject: Re: doubt with positive lookaround On 12/5/06, Martin DeMello wrote: > On 12/5/06, hemant wrote: > > I do not understand behavior of positive look arounds in Ruby: > > > > chunked_data = "DIVex>##ECHO=b698fd4cc1ea4c7a4b5c4e1d1c402911##" > > p $& if chunked_data =~ /(?=DIVex)DI/ # => DI > > > > However, > > > > chunked_data = "##ECHO=b698fd4cc1ea4c7a4b5c4e1d1c402911##" > > p $& if chunked_data =~ /(?= nil > > > > > > does < gets treated as special character inside (?= ..) ? > > No, but lookahead assertions are zero-width, so if your assertion > matches DI. p $& if chunked_data =~ /(?=