I need to find all the lines located between START and END, except for the PADDING substring from the matched string. The best way I've found is
$r="stuffSTARTthisPADDINGisENDstuffstuffSTARTwhatPADDINGIwantPADDINGtoPADDINGfindENDstuff" ; preg_match_all('/START(.*?)END/',str_replace('PADDING','',$r),$m); print(join($m[1])); > thisiswhatIwanttofind
I want to do this with a minimal code size: is it shorter only with preg_match_all and without str_replace, which ultimately returns directly a string without connection arrays? I tried with some external expressions, but I can not find the correct one.
source share