From: Anthony Bourque Date: 2012-02-03T05:32:20+09:00 Subject: [ruby-core:42326] [ruby-trunk - Bug #5961][Open] regular expression positive look-behind Issue #5961 has been reported by Anthony Bourque. ---------------------------------------- Bug #5961: regular expression positive look-behind https://bugs.ruby-lang.org/issues/5961 Author: Anthony Bourque Status: Open Priority: Normal Assignee: Anthony Bourque Category: core Target version: 1.9.3 ruby -v: 1.9.3p0 irb(main):001:0> input = " \t Jeffs " => " \t Jeffs " irb(main):002:0> input.gsub(%r{(?<=\bJeff)(?=s\b)},"'") SyntaxError: (irb):2: invalid pattern in look-behind: /(?<=\bJeff)(?=s\b)/ from E:/Ruby/Ruby193/bin/irb:12:in `
' irb(main):003:0> This is a valid regular expression which should produce " \t Jeff's ". It seems to have a problem with the \b in the look-behind. -- http://bugs.ruby-lang.org/