$re = '/href=([\'"])(?:.*\/wp-content\/uploads\/2018\/01\/(?:(?:.*( ))+?).*\.(?:pdf|doc|docx))\1/U';
$str = '<a href="/wp-content/uploads/2017/09/Some%20FileName%20That%20Wasnt%20sanitized%20at_all986.pdf">
<a title="Some title of the linked document" href="https://[redacted]/wp-content/uploads/2018/01/Some Title Thats Not Sanitized And Has Spaces 1.1.111-id1111.pdf" target="_blank" rel="noopener">Some Link Text For This</a></li>
';
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