Regular Expressions 101

Community Patterns

Community Library Entry

5

Regular Expression
PCRE (PHP <7.3)

/
([^\p{L}\s\d\-_~,;:\[\]\(\).'])
/
isg

Description

Useful for filename sanitization. Matches invalid filename characters. Can be used in preg_replace() calls.

Submitted by FractalizeR@yandex.ru - 9 years ago