Project

General

Profile

Bug #10670

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

The following simple script illustrates the issue: 

 ~~~ruby 
 

     ESCAPE_PLAIN = /\A[\x5B]*\z/m.freeze 

 

     0x5B.chr(::Encoding::UTF_8) =~ ESCAPE_PLAIN 
 
     0x5B.chr =~ ESCAPE_PLAIN 
 ~~~ 

 `\x5B` \x5B is `']'`, ']', run all lines above and get _in `=~': empty char-class: /\A[\x5B]*\z/m (RegexpError)_ 

 Comment out either the first or second usage and the error goes away.

Back