Project

General

Profile

Actions

Bug #14608

closed

Regexp::union and forward slashes

Added by jason.barnabe (Jason Barnabe) about 6 years ago. Updated about 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:86149]

Description

When using Regexp::union and a regular expression with a forward slash, there seem to be some inconsistencies.

# 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

Actions

Also available in: Atom PDF

Like0
Like0Like0