Authlib Regular Expression Bug
Brought to you by:
mukul
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