Project

General

Profile

Actions

Bug #14838

open

RegexpError with double "s" in look-behind assertion in case-insensitive unicode regexp

Added by jkamens@quantopian.com (Jonathan Kamens) over 6 years ago.

Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
[ruby-core:87464]

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


Related issues 2 (2 open0 closed)

Related to Ruby master - Bug #13671: Regexp with lookbehind and case-insensitivity raises RegexpError only on strings with certain charactersAssignedduerst (Martin Dürst)Actions
Related to Ruby master - Bug #16158: "st" Character Sequence In Regex Look-Behind Causes Illegal Pattern Error When Combined With POSIX Bracket Expressions And Case Insensitivity FlagOpenActions
Actions

Also available in: Atom PDF

Like0
Like0Like0