[#100689] [Ruby master Feature#17303] Make webrick to bundled gems or remove from stdlib — hsbt@...
Issue #17303 has been reported by hsbt (Hiroshi SHIBATA).
11 messages
2020/11/02
[#100852] [Ruby master Feature#17326] Add Kernel#must! to the standard library — zimmerman.jake@...
SXNzdWUgIzE3MzI2IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGpleiAoSmFrZSBaaW1tZXJtYW4pLg0K
24 messages
2020/11/14
[#100930] [Ruby master Feature#17333] Enumerable#many? — masafumi.o1988@...
Issue #17333 has been reported by okuramasafumi (Masafumi OKURA).
10 messages
2020/11/18
[#101071] [Ruby master Feature#17342] Hash#fetch_set — hunter_spawn@...
Issue #17342 has been reported by MaxLap (Maxime Lapointe).
26 messages
2020/11/25
[ruby-core:101049] [Ruby master Bug#17340] /\p{/ matches newline instead of throwing syntax error
From:
jiri.marsik@...
Date:
2020-11-24 11:19:07 UTC
List:
ruby-core #101049
Issue #17340 has been updated by jirkamarsik (Jirka Marsik).
Great, thanks!
----------------------------------------
Bug #17340: /\p{/ matches newline instead of throwing syntax error
https://bugs.ruby-lang.org/issues/17340#change-88720
* Author: jirkamarsik (Jirka Marsik)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The regular expression `/\p{/` matches newline characters instead of reporting a syntax error.
```
irb(main):001:0> /\p{/.match("\n")
=> #<MatchData "\n">
```
The issue stems from the function `fetch_char_property_to_ctype` in `regparse.c`. If the Unicode character property escape is not terminated with a right brace or some of the other unacceptable characters, the method will return 0 and will not be considered a failure. The number 0 is then interpreted as a `ctype` code which stands for the newline character property. Thus, this expression will end up matching newlines. I would guess that the intended behavior here would be to report a syntax error in the regular expression.
--
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>