From: janosch-x via ruby-core Date: 2026-11-23T18:45:11+00:00 Subject: [ruby-core:127684] [Ruby Bug#16158] "st" Character Sequence In Regex Look-Behind Causes Illegal Pattern Error When Combined With POSIX Bracket Expressions And Case Insensitivity Flag Issue #16158 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 #16158: "st" Character Sequence In Regex Look-Behind Causes Illegal Pattern Error When Combined With POSIX Bracket Expressions And Case Insensitivity Flag https://bugs.ruby-lang.org/issues/16158#change-120196 * Author: michaeltomko (Michael Tomko) * Status: Open * ruby -v: ruby 2.7.0dev (2019-09-11 master 146677a1e7) [x86_64-openbsd6.5] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- *This is my first Ruby bug submission. Please let me know if there is anything else that I can provide that would be helpful. Thanks for your time!* I've tried just about as many combinations as I can think of and I have been able to narrow down the issue to the following components being present in a regular expression. * The character sequence "st" either preceded by any characters OR being a part of a top-level alternation inside of a look-behind. The issue occurs with both positive and negative look-behinds. ex: `(? pat = /(? pat = /(?i)(? pat = /(? pat = /((? /((? pat = /((? /((? pat = /((? /((? pat = /(? /(? pat = /(? /(?