preg_match_all("%
(?:|(?<=[.,;])) # The end of the previous sentence
\s # Maybe some whitespace
discovery # Discovery
\s # space
.? # stuff
(extend|extension|cut\soff|dead\sline) # keyword
\s # space
.*? # more stuff
(\d{1,2}/\d{1,2}/\d{2,4}) # A date.
[.,;] # end of sentence
%six", $text, $matches,PREG_SET_ORDER);
"six": Match "\n" as a whitespace character; case-independent matching;
ignore whitespace and #comments in pattern.
$matches[n][1] will contain the keyword for the nth matching sentence,
$matches[n][2] will contain the date. $matches[n][0] will match the
entire sentence. To swap array indices so that $matches[1][n] is the
keyword for the nth matching sentence, either remove ",PREG_SET_ORDER"
or replace it with ",PREG_PATTERN_ORDER".