Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^([\w.]{1,})\.([\w]{3,4})\.([\w]{3,4})$
/
gm

Description

I use this to find files with two or more extensions (i.e. file.txt.txt). This will work with files with 3 or 4 character or numeric (or both) file extensions (i.e. pdf, xlsx).

Submitted by Curve - 8 months ago (Last modified 8 months ago)