[#106341] [Ruby master Bug#18369] users.detect(:name, "Dorian") as shorthand for users.detect { |user| user.name == "Dorian" } — dorianmariefr <noreply@...>
Issue #18369 has been reported by dorianmariefr (Dorian Mari辿).
14 messages
2021/11/30
[#106351] [Ruby master Bug#18371] Release branches (release information in general) — "tenderlovemaking (Aaron Patterson)" <noreply@...>
Issue #18371 has been reported by tenderlovemaking (Aaron Patterson).
7 messages
2021/11/30
[ruby-core:106323] [Ruby master Bug#13671] Regexp with lookbehind and case-insensitivity raises RegexpError only on strings with certain characters
From:
"mame (Yusuke Endoh)" <noreply@...>
Date:
2021-11-30 04:42:58 UTC
List:
ruby-core #106323
Issue #13671 has been updated by mame (Yusuke Endoh).
Assignee set to duerst (Martin Dテシrst)
Status changed from Open to Assigned
----------------------------------------
Bug #13671: Regexp with lookbehind and case-insensitivity raises RegexpError only on strings with certain characters
https://bugs.ruby-lang.org/issues/13671#change-94954
* Author: dschweisguth (Dave Schweisguth)
* Status: Assigned
* Priority: Normal
* Assignee: duerst (Martin Dテシrst)
* ruby -v: 2.4.1
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
Here is a test program:
~~~ ruby
def test(description)
begin
yield
puts "#{description} is OK"
rescue RegexpError
puts "#{description} raises RegexpError"
end
end
test("ass, case-insensitive, special") { /(?<!ass)/i =~ '笨ィ' }
test("bss, case-insensitive, special") { /(?<!bss)/i =~ '笨ィ' }
test("as, case-insensitive, special") { /(?<!as)/i =~ '笨ィ' }
test("ss, case-insensitive, special") { /(?<!ss)/i =~ '笨ィ' }
test("ass, case-sensitive, special") { /(?<!ass)/ =~ '笨ィ' }
test("ass, case-insensitive, regular") { /(?<!ass)/i =~ 'x' }
~~~
Running the test program with Ruby 2.4.1 (macOS) gives
~~~
ass, case-insensitive, special raises RegexpError
bss, case-insensitive, special raises RegexpError
as, case-insensitive, special is OK
ss, case-insensitive, special is OK
ass, case-sensitive, special is OK
ass, case-insensitive, regular is OK
~~~
The RegexpError is "invalid pattern in look-behind: /(?<!ass)/i (RegexpError)"
Side note: in the real code in which I found this error I was able to work around the error by using (?i) after the lookbehind instead of //i.
Running the test program with Ruby 2.3.4 does not report any RegexpErrors.
I think this is a regression, although I might be wrong and it might be saving me from an incorrect result with certain strings.
---Files--------------------------------
test.rb (531 Bytes)
--
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>