Issue #11038 has been updated by Nobuyoshi Nakada.

Description updated
Status changed from Open to Feedback

Seems a backtrack explosion.

Is the `?` just after `\.` really intentional?


----------------------------------------
Bug #11038: regular expression fail
https://bugs.ruby-lang.org/issues/11038#change-52056

* Author: Norberto Martins
* Status: Feedback
* Priority: Low
* Assignee: 
* ruby -v: ruby 2.0.0p598 (2014-11-13 revision 48408) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
the following regexp seems to loop
`/^([A-Z0-9_%+-]+\.?)+[^.]@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i`

with "ec-mat-charles-perrault-voves-28@ac-orleans-tours"

you can test with: 

~~~ruby
'ec-mat-charles-perrault-voves-28@ac-orleans-tours' =~ /^([A-Z0-9_%+-]+\.?)+[^.]@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i
~~~



-- 
https://bugs.ruby-lang.org/