i'm trying to formulate a regular expression to find prices in a string and put html tags around. i've come up with this :
$pattern = '/([1-9][0-9]*[,|.][0-9]{2})/i';
$replace = "<p>$1</p>";
$string = preg_replace($pattern, $replace, $string);
this works well so far for most cases except when something like 22,123 appears which will also be changed to
<p>22,12</p>3
how can i make this reg ex ignore numbers with more than two decimals?