From: duerst@... Date: 2016-02-27T09:11:45+00:00 Subject: [ruby-core:74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. Issue #12103 has been updated by Martin D��rst. Status changed from Open to Rejected I simplified this as follows: regex = /\(a+( ?a*)*\)/ detail = "(aaaa aaaaaaa aaaaa aaaaaaaaa aaaaa" It still hangs. But it's easier to see why: The part (a+( ?a*)* allows many different ways to match the same thing, and all these are tried. For more background, please see http://www.regular-expressions.info/catastrophic.html. ---------------------------------------- Bug #12103: ruby process hangs while executing regular expression. https://bugs.ruby-lang.org/issues/12103#change-57172 * Author: Antony Raj * Status: Rejected * Priority: Normal * Assignee: * ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15], jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 24.45-b08 on 1.7.0_45-b18 +jit [darwin-x86_64] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- The following code hangs ~~~ regex = /(\((\w+([\p{Punct}\s]{,3}\w*)*)\))/i detail = "(said companies being fictitous sellers" detail =~ regex ~~~ However when I change {,3} to {1,3}, the code executes and moves on. Otherwise hangs -- https://bugs.ruby-lang.org/ Unsubscribe: