Project

General

Profile

Actions

Bug #11038

closed

regular expression fail

Bug #11038: regular expression fail

Added by norti (Norberto Martins) over 10 years ago. Updated over 6 years ago.

Status:
Closed
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

Updated by nobu (Nobuyoshi Nakada) over 10 years ago Actions #1

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

Seems a backtrack explosion.

Is the ? just after \. really intentional?

Updated by jeremyevans0 (Jeremy Evans) over 6 years ago Actions #2

  • Status changed from Feedback to Closed
Actions

Also available in: PDF Atom