Regular Expressions 101

force download file (HTML5)

Open Workspace
  • PCRE2 (PHP)
  • Substitution
1

Regular Expression

/
(<a.*href=(("|')(.*pdf)("|')))
/
gm

Description

This regex is written for a Joomla plugin. This REGEX force to DOWNLOAD à PDF file instead of showing PDF in browser

Submitted by Sébastien LHUILLIER