<?php $str = 'I(0,123...789){ A(0,567...999){.......n=Marc.....} B(2,655...265){..................} C(3,993...333){..................} M(8,635...254){.................;} } O(0,345...789){ A(0,567...999){.......n=Marc.....} B(2,876...775){..................} C(3,993...549){..................} M(8,354...987){.................;} } I(0,987...764){ A(0,567...999){.......n=Marc.....} B(2,543...265){..................} C(7,998...933){..................} M(8,645...284){.................;} } B(0,123...789){ ....... } I(0,987...764){ A(0,567...999){.......n=John.....} B(2,543...265){..................} C(7,998...933){..................} M(8,645...284){.................;} }'; $res = preg_grep('/^I.*n=Marc/s', preg_split('/^}\R(?=[A-Z])/m', $str)); print_r($res);
You have javascript disabled. You will not be able to edit any code.