Re: quantifiers not working in ereg.*

From: Date: Sun, 25 May 2003 17:33:20 +0000
Subject: Re: quantifiers not working in ereg.*
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-148916@lists.php.net to get a copy of this message
On Sunday 25 May 2003 20:42, matze wrote: > on a redhat 8.0 box with php 4.1.2 rpm (from rh v7.2) installed > the ereg.* functions don't work as i expect. in some cases - > especially when "\r\n" sequences are involved - the ereg functions > don't match a string, although they should. i tested with the same > code on several machines, it works fine on all, only the above > mentioned redhat box causes problems: > > $foo ="barB\r\nfoo\r\n"; > if(ereg(".+\r\nfo", $foo)) > { > print('matched'); > } > else > { > print('not matched'); > } > > i expect the output 'matched', and actually i get it on all machines > but the redhat box. FWIW using RH7.2, PHP 4.3.0 compiled from source the above matches. > any idea what could be the reason for this behaviour? Stab in the darK: as of RH8 the locale settings were changed, not sure whether this has any bearing on your problem. Best ask on the RH list. Another thing, when you installed php didn't it complain? RH7.2 used Apache 1.3.X and RH8 uses Apache 2.X. BTW you're probably better off using the preg*() functions anyway. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* An apple every eight hours will keep three doctors away. */

« previous php.general (#148916) next »