All pastes #805482 Raw Edit

Someone

public php v1 · immutable
·published 2007-12-04 12:16 UTC
rendered paste body
$str = '111,222:';$digits = '\d{1,3}';$regex = "/((?:{$digits},{$digits})|):((?:{$digits},{$digits})|)?/";if(preg_match($regex, $str, $matches)){    var_dump($matches);}else{    echo 'you fail';}