3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = "1234 4569 "; $allowedInputSeparators = array('\r\n', '\n', '\t', ',', ';', '|', '\s'); $pattern = '/(.+?)' . implode('|', $allowedInputSeparators) . '/'; preg_match_all($pattern, $value, $matches, PREG_SET_ORDER); print_r($matches);

preferences:
44.62 ms | 402 KiB | 5 Q