Regular Expressions 101

Community Patterns

There does not seem to be anything here

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(\/.*?\/)([^\/](?:[^\/]|\\\/)+?)(?:(?<!\\)\s|$)
/

Description

Matches 2 groups - pathname and file basename, and will exclude anything on the end of the line that is not properly escaped.

Submitted by Steve Sant - 10 years ago