Project

General

Profile

Bug #5961

regular expression positive look-behind

Added by Anthony Bourque almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
[ruby-core:42326]

Description

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.

History

#1 [ruby-core:42336] Updated by Yui NARUSE almost 5 years ago

  • Status changed from Open to Assigned
  • Assignee changed from Anthony Bourque to Yui NARUSE

#2 [ruby-core:42754] Updated by Yui NARUSE almost 5 years ago

  • Status changed from Assigned to Closed

Fixed by mergin Onigmo 5.13.1 in Ruby 2.0.

Also available in: Atom PDF