Regular Expressions 101

Community Patterns

Filename without extension

0

Regular Expression
ECMAScript (JavaScript)

/
^(?:[^<>:;,?"*|/.\n]+(?=\.?|$)|[^<>:;,?"*|/\n]+)
/
gm

Description

Selects only the filename of a file, including dotfiles.

Submitted by anonymous - a year ago (Last modified 20 days ago)