Warning: eregi() [function.eregi]: REG_ERANGE in ...

From: Date: Thu, 17 Jan 2008 12:29:27 +0000
Subject: Warning: eregi() [function.eregi]: REG_ERANGE in ...
Groups: php.windows 
Request: Send a blank email to php-windows+get-28733@lists.php.net to get a copy of this message
I'm have trouble with some code that I have been following in a book regarding regular expressions. I'm attempting to validate an email using a regular expression. Below is a simplified version of the code which reproduces the problem I'm having: <?php define("EMAIL_RE", '^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$'); $email = trim($_GET['email']); $result = eregi(EMAIL_RE, $email); echo $result . "<br />\n"; if ($result) echo "Email valid"; else "Email invalid" ?> Calling this code with the argument get=bob@example.com, I'd expect an interger output something like this 15 Email valid Yet instead, all get is a warning that I cannot fathom and nothing else: Warning: eregi() [function.eregi]: REG_ERANGE in C:\Documents and Settings\daniel.stevens\My Documents\Workspace\htdocs\tutoring\eregi_test.php on line 4 I've tried searching for this warning to find out what it means, but I cannot find any reference to it on the web. Is anyone able to tell me what this warning means and why I am not getting the output I'm expecting? Can anyone advise how best to find out what a particular error or warning means so I don't have to ask on this list everytime I come across one that means nothing? php.net does not appear to have a list. Thanks in advance.

« previous php.windows (#28733) next »