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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to