From: nagachika00@... Date: 2014-06-29T18:13:13+00:00 Subject: [ruby-dev:48345] [ruby-trunk - Bug #9902] Regexp#[] ignores after NUL byte in named capture index Issue #9902 has been updated by Tomoyuki Chikanaga. rb_sym2str() doesn't exist in 2.1. Can I use rb_sym_to_s() instead? ---------------------------------------- Bug #9902: Regexp#[] ignores after NUL byte in named capture index https://bugs.ruby-lang.org/issues/9902#change-47453 * Author: Nobuyoshi Nakada * Status: Closed * Priority: Normal * Assignee: * Category: * Target version: * ruby -v: r46343 * Backport: 2.0.0: REQUIRED, 2.1: REQUIRED ---------------------------------------- Regexp#[]に"\0"を含む文字列やシンボルを指定したとき、それ以降が無視されます。 ~~~ $ ruby -w -e 'p(/(?.*)/.match("foo")["a\0foo"])' "foo" $ ruby -w -e 'p Regexp.new("(?.*?)").match("xxx")["foo\0bar"]' -e:1:in `[]': undefined group name reference: foo (IndexError) from -e:1:in `
' ~~~ -- https://bugs.ruby-lang.org/