From: jkamens@... Date: 2018-06-09T16:04:08+00:00 Subject: [ruby-core:87464] [Ruby trunk Bug#14838] RegexpError with double "s" in look-behind assertion in case-insensitive unicode regexp Issue #14838 has been reported by jkamens@quantopian.com (Jonathan Kamens). ---------------------------------------- Bug #14838: RegexpError with double "s" in look-behind assertion in case-insensitive unicode regexp https://bugs.ruby-lang.org/issues/14838 * Author: jkamens@quantopian.com (Jonathan Kamens) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- ~~~ irb(main):003:0> %r{(?)}ui Traceback (most recent call last): 1: from /usr/bin/irb:11:in `
' SyntaxError ((irb):3: invalid pattern in look-behind: /(?)/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 -- https://bugs.ruby-lang.org/ Unsubscribe: