Re: Returning part of a string, ereg..

From: Date: Tue, 17 Apr 2001 13:54:48 +0000
Subject: Re: Returning part of a string, ereg..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-48962@lists.php.net to get a copy of this message
try $part = ereg("([0-9]{1})-([0-9]*)-", $f, $regs); your original exp was looking for 1 digit followed by a dash follwed by 1 digit followed by a dash the * should match 0 or more occurences of the previous match ( in this case 0 or more numbers ) you shouldn't need the {1} in there either. morgan At 09:36 AM 4/17/2001 -0400, Chad Day wrote:
$part = ereg("([0-9]{1})-([0-9]{1,10})-", $f, $regs);


« previous php.general (#48962) next »