If you want to match the whole string and match the 2 date like patterns you could use 2 capturing groups.
Note that it does not validate the date itself.
\bfor\h+(\w+\h+\d{1,2},\h+\d{4})\h+to\h+((?1))\b
In parts
\bfor\h+ Word boundary, match for and 1+ horizontal whitespace chars
( Capture group 1
\w+\h+\d{1,2} Match 1+ word chars, 1+ horizontal whitespace chars and 1 or 2 digits
,\h+\d{4} Match a comma, 1+ horizontal whitespace chars and 4 digits
) Close group
\h+to\h+ Match to between 1+ horizontal whitspace chars
( Capture group 2
(?1) Subroutine call to capture group 1 (the same pattern of group 1 as it is the same logic)
) Close group
\b Word boundary
Regex demo
For example
$re = '/\bfor\h+(\w+\h+\d{1,2},\h+\d{4})\h+to\h+((?1))\b/';
$str = 'for April 1, 2017 to April 30, 2017';
preg_match_all($re, $str, $matches);
print_r($matches)
Output
Array
(
[0] => Array
(
[0] => for April 1, 2017 to April 30, 2017
)
[1] => Array
(
[0] => April 1, 2017
)
[2] => Array
(
[0] => April 30, 2017
)
)
preg_match_all('~\b[a-z]+\s*\d{1,2},\s*\d{4}\b~i', $contents, $matches), see the regex demo.\bfor\h+(\w+\h+\d{1,2},\h+\d{4})\h+to\h+((?1))\bregex101.com/r/LCvlqW/1