fork(1) download
  1. <?php
  2.  
  3. $arr = array('INA1C4A1', 'INA12C4A1', 'INA123C4A1', 'INA1234C4A1');
  4.  
  5. foreach($arr as $item){
  6. preg_match_all('/[A-Z]\d{1,2}/', $item, $m);
  7. print_r($m);
  8. }
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => A1
            [1] => C4
            [2] => A1
        )

)
Array
(
    [0] => Array
        (
            [0] => A12
            [1] => C4
            [2] => A1
        )

)
Array
(
    [0] => Array
        (
            [0] => A12
            [1] => C4
            [2] => A1
        )

)
Array
(
    [0] => Array
        (
            [0] => A12
            [1] => C4
            [2] => A1
        )

)