From: Charles Oliver Nutter Date: 2009-02-05T07:53:55+09:00 Subject: [ruby-core:21839] Re: What does this regexp mean - /\c#{_J}/ Shri Borde wrote: > I am combining the escaped control character syntax (\c/X/) with > variable interpolation (#{var_name}). It seems nonsensical, and its > probably only interesting for an academic interest (I am adding to the > RubySpecs). It does not seem to match anything at all. Its almost the > same output with both 1.8.6 and 1.9, but the warnings are given only in > 1.8.6. > > > > Should it be a syntax error? Or can it actually match something? > > > > irb(main):001:0> _J = "J" > > => "J" > > irb(main):002:0> re = /\c#{_J}/ > > (irb):2: warning: regexp has invalid interval > > (irb):2: warning: regexp has `}' without escape No warnings in JRuby but we appear to do the same thing. Parser artifact no doubt...I'd call it a bug. - Charlie