[#66126] Creation/Conversion methods/functions table for Ruby types — SASADA Koichi <ko1@...>
Hi,
5 messages
2014/11/07
[#66248] [ruby-trunk - Feature #10423] [PATCH] opt_str_lit*: avoid literal string allocations — normalperson@...
Issue #10423 has been updated by Eric Wong.
3 messages
2014/11/13
[#66595] [ruby-trunk - Bug #10557] [Open] Block not given when the argument is a string — bartosz@...
Issue #10557 has been reported by Bartosz Kopinski.
3 messages
2014/11/30
[ruby-core:66448] [ruby-trunk - Bug #10539] [Rejected] Wrong pattern matching when string interpolation inside regexp is used
From:
nobu@...
Date:
2014-11-25 01:08:10 UTC
List:
ruby-core #66448
Issue #10539 has been updated by Nobuyoshi Nakada.
Description updated
Status changed from Open to Rejected
You need parentheses.
----------------------------------------
Bug #10539: Wrong pattern matching when string interpolation inside regexp is used
https://bugs.ruby-lang.org/issues/10539#change-50073
* Author: tammo tjarks
* Status: Rejected
* Priority: Normal
* Assignee:
* Category: regexp
* Target version:
* ruby -v: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Hello,
maybe it is my fault, but I stumble over the fact, that I get a match when I should not (have added a short example).
I use an Array to have a list of matching names like:
~~~ruby
a = ['moin','test','whatever']
~~~
and when I compare with
strings like
~~~ruby
ex_strings = ["TOMATCH moin","SHOULNDTMATCH whatever"]
~~~
I get with
~~~ruby
str =~ /TOMATCH #{a.join("|")}/
~~~
(see attached example) a match for TOMATCH moin as well
as SHOULDNTMATCH whatever. I tried it with other versions as well.
I tried it with older versions of ruby as well with the same result.
Is the use of string Interpolation inside regular expressions problematic?
Best regards,
Tammo
---Files--------------------------------
example.rb (178 Bytes)
--
https://bugs.ruby-lang.org/