3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "abc pqrs-1/2&3uvw xyz"; if (preg_match('~([a-z]+)((?:[^0-9a-z][0-9])+)([a-z]+)~', $str, $matches)) { preg_match_all('~[^0-9a-z][0-9]~', $matches[2], $x); $matches[2] = $x[0]; } print_r($matches);

preferences:
35.24 ms | 402 KiB | 5 Q