fork(1) download
  1. <?php
  2.  
  3. $re = '/(?:\G(?!^)|(?=(?:[e-g]\d+)+c))[e-g]\d+/';
  4. $str = 'e123f654g933c and e123f654g933ce99f77g66c';
  5. preg_match_all($re, $str, $matches);
  6. print_r($matches[0]);
Success #stdin #stdout 0.01s 82816KB
stdin
Standard input is empty
stdout
Array
(
    [0] => e123
    [1] => f654
    [2] => g933
    [3] => e123
    [4] => f654
    [5] => g933
    [6] => e99
    [7] => f77
    [8] => g66
)