3v4l.org

run code in 500+ 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:
121.09 ms | 1465 KiB | 5 Q