| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2002-05-14 12:31 UTC] rasmus@php.net
  [2002-05-14 16:05 UTC] postings dot php dot net at hans-spath dot de
  [2002-05-14 19:30 UTC] rasmus@php.net
  [2002-05-15 07:49 UTC] alxwe at t-online dot de
  [2002-05-15 07:50 UTC] webmaster at linuxconfig dot de
  [2002-05-15 08:36 UTC] rasmus@php.net
  [2002-05-15 10:07 UTC] webmaster at linuxconfig dot de
  | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 10:00:02 2025 UTC | 
I tried to check email with $check = ereg('^[0-9A-Za-z_\-\.]+@[0-9A-Za-z_\-]+\.[0-9A-Za-z_\-\.]+[0-9A-Za-z_\-]+$',$email); This does not work with 'xxx-yyy@zzz.com', for example, althoug the regular expression is correct. It works this way in any other programming language. But if you write it in the following way it also works fine in PHP: $check = ereg('^[\.0-9A-Za-z_\-]+@[0-9A-Za-z_\-]+\.[\.0-9A-Za-z_\-]+[0-9A-Za-z_\-]+$',$email); Maybe the parser thinks of "-" as the range separator, althoug it is written as \- ?