$re = '/^(?:[1-7](?:\.[0-9]{1,2})?|8(?:\.[0-4][0-9]?|\.50?)?|0\.0[1-9]|0\.[1-9][0-9]?)$/mx';
$str = '0.00
0
00
0.1
0.79
1
1.9
2
7.64
2
3
4
5
6
7
8
1.1
2.1
3.9
4.5
5.3
6.2
7.4
8.4
8.1
8.0
8.1
8.0
8.01
8.09
8.49
8.9
8.5
8.6
0.01
0.02
0.10
0.10
0.19
0.90
1.00
1.11
4.00
7.99
8.00
8.01
8.49
8.50
8.51
8.60
9.00
9.01
10
10.00
10.01
100.99';
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