Project

General

Profile

Actions

Bug #5961

closed

regular expression positive look-behind

Added by kbourque@sbcglobal.net (Anthony Bourque) almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
ruby -v:
1.9.3p0
Backport:
[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.

Actions

Also available in: Atom PDF

Like0
Like0Like0