Project

General

Profile

Bug #11038

regular expression fail

Added by norti (Norberto Martins) over 5 years ago. Updated about 1 year 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
#1

Updated by nobu (Nobuyoshi Nakada) over 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) about 1 year ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF