3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
array(5) { [0]=> string(7) "ASFXB10" [1]=> string(2) "AS" [2]=> string(2) "FX" [3]=> string(1) "B" [4]=> string(2) "10" }