3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define("EXPREG","/^(\s*\n*'[\d]+(-\d+)?')(\s*\n+\s*'[\d]+(-\d+)?')*\n*\s*$/i"); function test($raw){ if(preg_match(EXPREG,$raw)){ return json_encode(true); }else{ return json_encode(preg_last_error()); } } $raw="'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n'12345'\n "; $r=test($raw); echo $r;
based on BNkQb
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0beta1
true