3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseTicketName($ticketName) { preg_match('/^([[:alpha:]]{2})([[:alpha:]]+)(b+)([[:digit:]]+)$/', $ticketName, $matches); var_dump($matches); exit; return array( 'system' => $matches[1], 'project' => $matches[2], 'ticket_id' => $matches[3] ); } // 2 first characters is system, then the next letters are project name and the numbers are the ticket id $s = "ASFXB10"; var_dump(parseTicketName($s));

preferences:
39.68 ms | 402 KiB | 5 Q