From: "naruse (Yui NARUSE) via ruby-core" Date: 2023-03-22T01:34:30+00:00 Subject: [ruby-core:112974] [Ruby master Bug#19467] Some linear_time regexp does not match in linear time Issue #19467 has been updated by naruse (Yui NARUSE). Backport changed from 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONE ruby_3_2 4b4087dce318570f9f9c05e14900325b499fb632 merged revision(s) e22c4e8877677ff90805e4a4dcbdef80f4220136. ---------------------------------------- Bug #19467: Some linear_time regexp does not match in linear time https://bugs.ruby-lang.org/issues/19467#change-102502 * Author: tompng (tomoya ishida) * Status: Closed * Priority: Normal * Assignee: make_now_just (Hiroya Fujinami) * ruby -v: ruby 3.3.0dev (2023-02-17T18:10:16Z master c3bae033eb) [x86_64-linux] * Backport: 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONE ---------------------------------------- `Regexp.linear_time?(/\A.*a.*x\z/) #=> true` but it does not match in linear time ~~~ruby Regexp.linear_time? /\A(.*a.*)x\z/ #=> true /\A(.*a.*)x\z/ =~ 'a'*100000+'y' #=> nil, processing time: 0.016995s Regexp.linear_time? /\A.*a.*x\z/ #=> true /\A.*a.*x\z/ =~ 'a'*100000+'y' #=> nil, processing time: 21.479335s ~~~ -- 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/postorius/lists/ruby-core.ml.ruby-lang.org/