$re = '/Retails_OB_(?<YYYY>\d{4})(?<MM>\d{2})(?<DD>\d{2}).csv/m';
$str = 'Retails OB.csv
Retails_OB_20200717.csv
Retails_OB_20200723.csv
Retails_OB_20200804.csv
Retails_OB_20200814.csv
Retails_OB_20200821.csv
Retails_OB_20200825.csv
Retails_OB_20200902.csv
Retails_OB_20200910.csv
Retails_OB_20200917.csv
Retails_OB_20200924.csv
Retails_OB_20200929.csv
Retails_OB_20201006.csv
Retails_OB_20201013.csv
Retails_OB_20201021.csv
Retails_OB_20201028.csv
Retails_OB_20201119.csv
Retails_OB_20201125.csv
Retails_OB_20201214.csv
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php