Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
[a-zA-Z0-9\/\\\_\!\#\$\%\&\'\(\)\+\,\.\:\=\@\[\]\^\-\`\{\}~\s]*
/
g

Description

This regular expression removes all special characters including whitespaces which are allowed in windows path name, file name and folder name.

Submitted by Anirudh - 9 years ago