From: davidomundo@... Date: 2019-06-19T01:17:58+00:00 Subject: [ruby-core:93232] [Ruby trunk Bug#15938] Error thrown undeterministically: `RegexpError: empty range in char class` Issue #15938 has been reported by dlee (David Lee). ---------------------------------------- Bug #15938: Error thrown undeterministically: `RegexpError: empty range in char class` https://bugs.ruby-lang.org/issues/15938 * Author: dlee (David Lee) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.4.6 * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- When instantiating a Regexp, we only sometimes see `RegexpError: empty range in char class`. To reproduce: `100.times { Regexp.new("^([\\w'+-.%]+@[\\w-.]+\\.[A-Za-z]{2,25})(,[\\w+-.%]+@[\\w-.]+\\.[A-Za-z]{2,4}){0,4}$") }` usually does not throw the error, but `100000.times { Regexp.new("^([\\w'+-.%]+@[\\w-.]+\\.[A-Za-z]{2,25})(,[\\w+-.%]+@[\\w-.]+\\.[A-Za-z]{2,4}){0,4}$") }` usually throws the error. Furthermore, sometimes accompanying calls matter: `10.times { Regexp.new("[\\w-.]"); Regexp.new("[\\w-]") }` usually does not throw the error, but `10.times { Regexp.new("[\\w-.]") }` usually throws the error. -- https://bugs.ruby-lang.org/ Unsubscribe: