Regular Expressions 101

Community Patterns

Linux Folder Name Regex

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^\w{1,14}$
/
gm

Description

Regex to check if a given folder name is valid linux.

Limited to 14 chars so it includes older linux version. If you know you will be using a newer version you can use the 255 limit for chars.

Submitted by anonymous - a year ago