Issue #8133 has been updated by mame (Yusuke Endoh).


Just for information: r39858 introduces the behavior change.
Whether %r{n{3\}}} matches with:

          | "nnn}" | "n{3}}"
----------+--------+---------
1.9.3p392 |  YES   |  NO
2.0.0p0   |  NO    |  YES
trunk     |  YES   |  NO

-- 
Yusuke Endoh <mame / tsg.ne.jp>
----------------------------------------
Bug #8133: Regexp macro %r{} is loosing backslash on "\}"
https://bugs.ruby-lang.org/issues/8133#change-37797

Author: jstribny (Josef Stribny)
Status: Closed
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/