From: janosch-x via ruby-core Date: 2026-11-23T18:45:43+00:00 Subject: [ruby-core:127685] [Ruby Bug#14838] RegexpError with double "s" in look-behind assertion in case-insensitive unicode regexp Issue #14838 has been updated by janosch-x (Janosch M�ller). this has been fixed in ruby 4.0.0 via issue #13671 and commit [bfbbcf3](https://github.com/ruby/ruby/commit/bfbbcf34557b0aad4f5ed045df3e4e86b11c9a8c), with backports to ruby 3.3.11 and 3.4.8. ---------------------------------------- Bug #14838: RegexpError with double "s" in look-behind assertion in case-insensitive unicode regexp https://bugs.ruby-lang.org/issues/14838#change-120197 * Author: jkamens@quantopian.com (Jonathan Kamens) * Status: Open * 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/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/