3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/([A-Z][a-z]*)(\d*[-+]?)/'; $str = 'K+ Cr7+ O2-'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); print_r($matches);

preferences:
38.94 ms | 405 KiB | 5 Q