$re = '/^\d+(?:(?:,\d{3})*(?:\.\d{1,2})?|\.\d+)$/m';
$str = '1.71
171
1.71717171
171.00
1770
1,700
1,700.00
1,777,777
1,777,777.00
1777777.00
1,444444,4444444,444444.22
1,333,333,333.233
171,00
1777777,00
1,00';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php