From: shibata.hiroshi@... Date: 2014-08-12T07:27:12+00:00 Subject: [ruby-core:64337] [ruby-trunk - Bug #9517] [Rejected] why not match ? Issue #9517 has been updated by Hiroshi SHIBATA. Status changed from Open to Rejected ---------------------------------------- Bug #9517: why not match ? https://bugs.ruby-lang.org/issues/9517#change-48319 * Author: kk kk * Status: Rejected * Priority: Normal * Assignee: * Category: regexp * Target version: * ruby -v: ruby 2.0.0p353 (2013-11-22 revision 43784) [i686-linux] * Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- ``` class String def jhex self.split(/,|\s+/).map{|x| x.hex}.pack('c*') end end s = "01 00 28 09 00 04 02 00 27 AA" .jhex s1 = "01 00 05 09 00 04 02 00 0A AA" .jhex s .force_encoding 'ascii-8bit' s1.force_encoding 'ascii-8bit' r = Regexp.new '[\001\002\003]\000(.*?)\xAA' , nil , 'n' s .match(r) #=> # s1.match(r) #=> nil #why? ``` -- https://bugs.ruby-lang.org/