Regular Expressions 101

Community Patterns

Community Library Entry

-1

Regular Expression
PCRE (PHP <7.3)

/
^(?:.*[\/\\])?(?<FileNameWithoutExtension>.*)\.(.*)$
/
gm

Description

Best REGEX for extracting FILENAME WITHOUT EXTENSION and EXTENSION from any Posix-like path (version 4)

Submitted by anonymous - 2 years ago