Issue #8133 has been updated by vo.x (Vit Ondruch).

Status changed from Rejected to Open

It doesn't look to be issue of regexp but issue of parser:


C:\Projects>irb
irb(main):001:0> a = %r|\}|
=> /\}/
irb(main):002:0> b = %r{\}}
=> /}/
irb(main):003:0> a == b
=> false

a and b are apparently not the same. They used to be the same in Ruby 1.9.3.
----------------------------------------
Bug #8133: Regexp macro %r{} is loosing backslash on "\}"
https://bugs.ruby-lang.org/issues/8133#change-37785

Author: jstribny (Josef Stribny)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: current: 2.1.0
ruby -v: 2.0.0


Hello,

Ruby 2.0.0 is loosing the backslash when used on "\}" string (exact match). 

How to reproduce in irb:

2.0.0-p0 :003 > %r{\}}
 => /}/ 
2.0.0-p0 :004 > %r{\{}
 => /\{/ 

Compared to:

1.9.3p392 :001 > %r{\{}
 => /\{/ 
1.9.3p392 :002 > %r{\}}
 => /\}/

This shouldn't probably happen.


-- 
http://bugs.ruby-lang.org/