3v4l.org

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

preferences:
40.66 ms | 402 KiB | 5 Q