3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings=[ 'e123f654g933c', 'e123f654g933ce99f77g66c' ]; foreach($strings as $string){ var_export( array_map( function($v){ return preg_match_all('/[e-g]\d+/',$v,$out2)?$out2[0]:[]; }, preg_match_all('/(?:[e-g]\d+)+(?=c)/',$string,$out1)?$out1[0]:[] ) ); echo"\n\n"; }

preferences:
24.7 ms | 406 KiB | 5 Q