Community Patterns

Community Library Entry

0

Regular Expression
Created·2015-07-10 20:33
Flavor·ECMAScript (JavaScript)

/
^(?![\._]|.*?\.\..*|.*(?:\.|\.files|_files|-Dateien|_fichiers|_bestanden|_file|_archivos|-filer|_tiedostot|_pliki|_soubory|_elemei|_ficheiros|_arquivos|_dosyalar|_datoteke|_fitxers|_failid|_fails|_bylos|_fajlovi|_fitxategiak)$)[^!#%&*{}\:<>?\\\/|"]+$
/
i
Open regex in editor

Description

The file name validation algorithm from MS KB905231, I assumed the prohibited suffixes included the file extension. I.e. 'foo.doc.files' would not match but 'foo.files.doc' would.

Submitted by David Nelson