Project

General

Profile

Actions

Bug #11038

closed

regular expression fail

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

Updated by nobu (Nobuyoshi Nakada) about 9 years ago

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

Seems a backtrack explosion.

Is the ? just after \. really intentional?

Actions #2

Updated by jeremyevans0 (Jeremy Evans) almost 5 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0