From: shevegen@... Date: 2018-03-16T00:21:06+00:00 Subject: [ruby-core:86150] [Ruby trunk Bug#14608] Regexp::union and forward slashes Issue #14608 has been updated by shevegen (Robert A. Heiler). Interesting. I would have expected them to be the same. Would be nice if it could be explained in the official docs too at http://ruby-doc.org/core-2.5.0/Regexp.html#method-c-union ---------------------------------------- Bug #14608: Regexp::union and forward slashes https://bugs.ruby-lang.org/issues/14608#change-71029 * Author: jason.barnabe (Jason Barnabe) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.5.0 * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- When using Regexp::union and a regular expression with a forward slash, there seem to be some inconsistencies. ~~~ ruby # this is weird Regexp.union(/\//, '') # => /(?-mix:\/)|/ Regexp.union(/\//, '') == /(?-mix:\/)|/ # => false # here is the difference Regexp.union(/\//, '').source # => "(?-mix:\\/)|" /(?-mix:\/)|/.source # => "(?-mix:/)|" ~~~ Previously reported at https://github.com/janosch-x/js_regex/issues/6 -- https://bugs.ruby-lang.org/ Unsubscribe: