Regular Expressions 101

Community Patterns

Get filename without extension from both windows and linux

1

Regular Expression
PCRE (PHP <7.3)

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

Description

Get filename without extension from both windows and linux full file paths

Submitted by anonymous - 8 years ago