<?php $re = '/^# cat B.*?(cat).*?(ugly).*?^# cat C$/ms'; $str = '# cat A the cat is very cute. # cat B the cat is very ugly. # cat C the cat is very good. #'; preg_match_all($re, $str, $matches, PREG_SET_ORDER); array_shift($matches[0]); print_r($matches[0]);
You have javascript disabled. You will not be able to edit any code.