Regular Expressions 101

Community Patterns

1...34567...902

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 - 10 years ago