From: kentkt@... Date: 2014-09-11T13:34:52+00:00 Subject: [ruby-core:64963] [ruby-trunk - Bug #9728] Regexp bug Issue #9728 has been updated by Ken Takata. This bug is fixed with the following Onigmo's commit: https://github.com/k-takata/Onigmo/commit/15ddec6d18e27fdc1988236764e766fd5892ecf5 This fix is included in Onigmo 5.15.0. ---------------------------------------- Bug #9728: Regexp bug https://bugs.ruby-lang.org/issues/9728#change-48847 * Author: Tsuyoshi Sawada * Status: Open * Priority: Normal * Assignee: * Category: * Target version: * ruby -v: Ruby 2.0 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- As reported in StackOverflow (http://stackoverflow.com/questions/23004527) (with a wrong expectation), the following regex pattern with the `*` operator does not match. "ab" =~ /(?!^a).*b/ # => nil When `?` is used instead, it seems to match correctly: "ab" =~ /(?!^a).?b/ # => 1 According to the original reporter of the linked site, this does not happen in Ruby 1.9.3. -- https://bugs.ruby-lang.org/