Bug #13822: ereg vs eregi
| From: | mick at nederland dot net | Date: | Thu, 25 Oct 2001 12:29:13 +0000 |
| Subject: | Bug #13822: ereg vs eregi | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-68998@lists.php.net to get a copy of this message | ||
From: mick@nederland.net
Operating system: Linux
PHP version: 4.0.6
PHP Bug Type: *Regular Expressions
Bug description: ereg vs eregi
We have build a function to convert iso to euro dates, therefor we use
regular expressions.
The code shows a line needed for a boolean return wether or not the date is
in iso style.
if(!ereg("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})$", $iso_time, $regs))
The ereg version is working perfectly, however the eregi version will fail
9 out of 10 times.
Installed modules:
'./configure' '--prefix=/usr' '--with-config-file-path=/etc'
'--disable-debug' '--enable-pic' '--enable-inline-optimization'
'--with-apxs=/usr/sbin/apxs' '--with-dom' '--with-exec-dir=/usr/bin'
'--with-regex=system' '--with-gettext' '--with-gd'
'--with-jpeg-dir=/usr'
'--with-png' '--with-ttf' '--with-zlib' '--with-db3'
'--with-gdbm'
'--with-openssl' '--with-layout=GNU' '--with-universe=/opt/mico-2.3.5'
'--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode'
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm'
'--enable-track-vars' '--enable-yp' '--enable-ftp'
'--enable-wddx'
'--without-mysql' '--without-unixODBC' '--without-oracle'
'--without-oci8'
'--with-pspell' '--with-xml'
--
Edit bug report at: http://bugs.php.net/?id=13822&edit=1