<?php $strings = [ "A12B8Y9CC10", "V5C8I17", "KK18II9", "I8VV22ZZ4S9U2", "A18Z12I" ]; $pattern = '/[A-Z]{2,}\d+(*SKIP)(*FAIL)|[A-Z]\K\d+/'; foreach ($strings as $string) { preg_match_all($pattern, $string, $matches); print_r($matches[0]); }
You have javascript disabled. You will not be able to edit any code.