From: Warren Brown Date: 2004-09-24T02:58:24+09:00 Subject: Re: Matchdata#end one character after match? T., > I know this is probably just the way it works, but I > was a bit antiPOLSed. > > irb(main):016:0> md = /X/.match("yzXrb") > => # > irb(main):018:0> p md.begin(0) > 2 > => nil > irb(main):017:0> p md.end(0) > 3 > => nil > > 3 and not 2? irb(main):018:0> md = /(?=X)/.match("yzXrb") => # irb(main):019:0> p md.begin(0) 2 => nil irb(main):020:0> p md.end(0) 2 => nil Does it make more sense now? - Warren Brown