<?php $re = '/(?:\G(?!^)|(?=(?:[e-g]\d+)+c))[e-g]\d+/';$str = 'e123f654g933c and e123f654g933ce99f77g66c';preg_match_all($re, $str, $matches);print_r($matches[0]);
Standard input is empty
Array ( [0] => e123 [1] => f654 [2] => g933 [3] => e123 [4] => f654 [5] => g933 [6] => e99 [7] => f77 [8] => g66 )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!