[ruby-core:75914] [Ruby trunk Bug#12477] Regexp with x modifier does not ignore space in character class
From:
daniel@...42.com
Date:
2016-06-09 17:39:55 UTC
List:
ruby-core #75914
Issue #12477 has been reported by Daniel DeLorme. ---------------------------------------- Bug #12477: Regexp with x modifier does not ignore space in character class https://bugs.ruby-lang.org/issues/12477 * Author: Daniel DeLorme * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.3.2p120 (2016-05-21 revision 55092) [x86_64-linux] * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- The x modifier should cause all non-escaped spaces to be ignored in a regexp, right? But consider that ~~~ / [a] /x =~ " " #=> nil / [ ] /x =~ " " #=> 0 ~~~ So spaces inside a character class are always literal, regardless of the x modifier. This has got to be a bug right? -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>