Tuesday, July 9, 2019

Regex - Get Filename and file extension

Regular Expression to separate the filename from the extension.
Regex Get Filename:        [^\/]*(?=\.[^.]+($|\?))

Regex Get File Extension:  \.[^.\\\/:*?"<>|\r\n]+$ 
   (includes period .ext)