Project

General

Profile

Actions

Bug #10670

closed

char-class matching same character with different encodings raises exception

Added by gkellogg (Gregg Kellogg) almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
[ruby-core:67193]

Description

The following simple script illustrates the issue:

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

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

\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.


Related issues 2 (0 open2 closed)

Related to Ruby master - Bug #10382: s = '\x80'; /#{s}/ raises an exception in US-ASCII scriptClosed10/14/2014Actions
Has duplicate Ruby master - Bug #10733: Time.httpdate raises ArgumentError when DateTime.now.httpdate is provided as inputClosed01/12/2015Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0