Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

valid filename regex

/^(?!.)(?!com[0-9]$)(?!con$)(?!lpt[0-9]$)(?!nul$)(?!prn$)[^|*?:<>/$"]*[^.|*?:<>/$"]+$/

Must not be empty.
Must not start with .
Must not be com0-com9, con, lpt0-lpt9, nul, prn
Must not contain | * ?  : < > $
Must not end with .
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #valid #filename #regex
ADD COMMENT
Topic
Name
5+2 =