Project

General

Profile

Bug #11038

regular expression fail

Added by norti (Norberto Martins) almost 5 years ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p598 (2014-11-13 revision 48408) [x86_64-linux]
[ruby-core:<unknown>]

Description

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:

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

History

#1

Updated by nobu (Nobuyoshi Nakada) almost 5 years ago

  • Description updated (diff)
  • Status changed from Open to Feedback

Seems a backtrack explosion.

Is the ? just after \. really intentional?

#2

Updated by jeremyevans0 (Jeremy Evans) 6 months ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF