Line 16 needs to be:
preg_match('~.*/(.*)\.(.*?)$~', $post->guid, $file_parts);
As it is the filename “Tob.-Couns.-referral-form.pdf” only allows editing “Tob” and recognizes the rest as the extension. It looks like the regex is correct on line 98.
Apologies if I overlooked something.
- The topic ‘Error in regex for files with multiple periods’ is closed to new replies.