Ereg problems
| From: | Jeff McKeon | Date: | Thu, 25 Mar 2004 23:31:02 +0000 |
| Subject: | Ereg problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-181521@lists.php.net to get a copy of this message | ||
Having some problems with ereg()
[begin code]
$string="Credit adjusted: $-1.32 to $48.68"
ereg("([\\$(\\$-)][0-9]+\.[0-9]+)",$data[2],$found);
While(list($index,$hits)=each($found))
{
echo "$index , $hits<br>";
}
[end code]
Returns
0 , $48.68
1 , $48.68
Am I doing something wrong with my regex or is there a problem here.
What I need is all the dollar amounts pulled out (with a negative sign
if there).
Thanks,
Jeff