3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = 'we 1,2000,2000,000,000,000,000,000,000,100.99 wf '; $string = 'we +1200300400500600700800900,99 wf '; //preg_match_all('/([+-])?[\d.,]+([.,]\d{1,2})?/', $string, $matches); //preg_match_all("/[+-]?\d{1,3}[.,]+(\d{3}[.,'])(?R)?/", $string, $matches); //preg_match_all("/[+-]?\d{1,3}[., ]?(?:\d{3}[., ]?)(?R)?/", $string, $matches); preg_match_all("/[+-]?\d{1,3}[., ]?(?:\d{3}[., ]?)(?R)?\d{3}/", $string, $matches); print_r($matches);
based on YJ7PC
Output for 7.3.0alpha1 - 7.3.0beta1
Array ( [0] => Array ( [0] => +1200300400500600700800900 ) )
Output for 4.4.3 - 4.4.9, 5.1.3 - 7.2.6
Array ( [0] => Array ( [0] => +120030040 [1] => 050060070 [2] => 0800900 ) )
Output for 4.3.0 - 4.4.2, 5.0.0 - 5.1.2
Array ( [0] => Array ( [0] => +120030040050060070080090 ) )