Menu

#2 Authlib Regular Expression Bug

open
nobody
None
5
2001-05-03
2001-05-03
Anonymous
No

We have found the following error in the regular
expression used to check validity of email addresses.
The original code is:

if (!eregi("^([a-z0-9]+)([._-]([a-z0-9]+))*[@]([a-z0-9]
+)([._-]([a-z0-9]+))*[.]([a-z0-9]){2}([a-z0-9])?$",
$email)) {

And should be, in our belief:

if (!eregi("^([a-z0-9]+)([._-]([a-z0-9]*))*[@]([a-z0-9]
+)([._-]([a-z0-9]+))*[.]([a-z0-9]){2}([a-z0-9])?$",
$email)) {

So that this address, as an example, is accepted:

Quentin_@hotmail.com

The suggested change is the '*' instead of the '+',
before the '@'.

Great script, anyways! :)

Urko Masse
umasse@arista.es

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.