PHP 4.0 Bug #8610 Updated: ereg* complains without cause
| From: | sam at ananova dot com | Date: | Tue, 09 Jan 2001 08:53:41 +0000 |
| Subject: | PHP 4.0 Bug #8610 Updated: ereg* complains without cause | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-43519@lists.php.net to get a copy of this message | ||
ID: 8610
User Update by: sam@ananova.com
Status: Open
Old-Bug Type: Calendar problems
Bug Type: Regexps related
Description: ereg* complains without cause
Corrected bug type
Previous Comments:
---------------------------------------------------------------------------
[2001-01-09 03:51:27] sam@ananova.com
if (eregi('^(ab|)c$',$x)) print "blah: $x<br>n";
complains with
Warning: REG_EMPTY in /usr/local/ananova_v2/www/search/_index.php on line 31
and returns false regardless of $x
yet:
echo "c" | egrep '^(ab|)c$'
echo "ac" | egrep '^(ab|)c$'
echo "abc" | egrep '^(ab|)c$'
outputs:
c
abc
Removing the from my php expression | stops the complaint but ruins the pattern.
My pattern intends to read (in english)
Optionally prefixed by "ab" and matches "c" exactly.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8610