Hello,

I'm using the following code to validate an e-mail address:

Code:
if (eregi("(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(\.$)|(\|)",$email) or !eregi("^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$",$email))
   {
   .......
   }
But the problem is that it does not work! I used to use this exact code in Perl and there it used to work fine.

Can anyone tell me why it does not work?