Actions
Bug #14838
openRegexpError with double "s" in look-behind assertion in case-insensitive unicode regexp
Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
Description
irb(main):003:0> %r{(?<!bss>)}ui
Traceback (most recent call last):
1: from /usr/bin/irb:11:in `<main>'
SyntaxError ((irb):3: invalid pattern in look-behind: /(?<!bss>)/i)
The error goes away if you remove the "u" or "i" modifier. It comes back if you leave just the "i" modifier and then apply the regexp to a unicode string, since at that point the regexp gets converted to unicode.
See also the same bug in JRuby: https://github.com/jruby/jruby/issues/5086
And their fix: https://github.com/jruby/jruby/commit/a72224d8a010f162d797e79cf73c21e78c0d59a0
Updated by znz (Kazuhiro NISHIYAMA) over 6 years ago
- Related to Bug #13671: Regexp with lookbehind and case-insensitivity raises RegexpError only on strings with certain characters added
Updated by jeremyevans0 (Jeremy Evans) about 5 years ago
- Related to Bug #16158: "st" Character Sequence In Regex Look-Behind Causes Illegal Pattern Error When Combined With POSIX Bracket Expressions And Case Insensitivity Flag added
Actions
Like0
Like0Like0