Regular Expressions 101

Community Patterns

1...567

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?P<Root>file\:\/\/\/(?:[A-Za-z]+):(?:\/|\\)|https\:\/\/)(?P<Relative>(?:(?:[^<>:"\/\\|?*\n])+(?:\/|\\))+)(?P<File>(?:[^<>:"\/\\|?*\n]+)(?:\.(?:pdf)))$
/
mg

Description

Made for my niche use of adding it to match either PDF files that being viewed directly from a website or when viewed from your local computer. This was done so that I can add it on my usercontent.css file in Firefox with the @-moz-document url-prefix

Submitted by Benji The Doggy - a year ago (Last modified a year ago)