正则表达式preg_match问题与逗号

This is my code to pre_match when an amount looks like this: $ 99.00 and it works

if (preg_match_all('/[$]\s\d+(\.\d+)?/', $tout, $matches))
{ $tot2 = $matches[0];
$tot2 = preg_replace("/\\\$/", '', $tot2);}

I need to do the same thing for a amount that looks like this (with a comma): $ 99,00

Thank you for your help (changing dot for comma do not help, there is an "escape" thing I do not understand...

Idealy I need to preg_match any number that looks like an amount with dot or commas and with or without dollar sign before or after (I know, it's a lot to ask :) since on the result form I want to scan there are phone and street numbers...

UPDATE (For some reason I cannot comment on replies) : To test properly, I need to preg_replace the comma by a dot (since we are dealings with sums, I don't think calculations can be done on numbers with commas in it).

So to clarify my question, I should say : I need to transform, let's say "$ 200,24" to "200.24". (could be amounts bettween 0.10 to 1000.99) :

    $tot2 = preg_replace("/\\\$/", '', $tot2);}

(this code just deals with the $ (it works), I need adaptation to deal also with the change of (,) for (.))

replace the . character with a character class [,.] which includes both a dot(.) and comma(,)

'/[$]\s\d+([.,]\d+)?/'

edit: comment is correct, regex fixed.

No, using , in place of \. works perfectly fine.

It's just that your input does not contain a space between dollar sign and amount $ 99,00 like your .-using source did.

Make the \s optional.

How about:

$str='$ 200,24';
echo str_replace(array('$',',',' '), array('','.',''), $str);

output:

200.24