php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13822 ereg vs eregi
Submitted: 2001-10-25 08:29 UTC Modified: 2001-11-10 15:41 UTC
From: mick at nederland dot net Assigned:
Status: Closed Package: Regexps related
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
 [2001-10-25 08:29 UTC] mick at nederland dot net
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'



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-10 15:39 UTC] sander@php.net
Works fine for me.
 [2001-11-10 15:41 UTC] sander@php.net
I meant closed :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 12 06:01:30 2024 UTC