regex:file_types
This is an old revision of the document!
Regex - File Types
^.*\.(jpg|JPG|gif|GIF|doc|DOC|pdf|PDF)$
^.+\.(?:(?:[dD][oO][cC][xX]?)|(?:[pP][dD][fF]))$
NOTE: This will accept .doc, .docx, .pdf files having a filename of at least one character:
- ^ - beginning of string.
- .+ - at least one character (any character).
- \. - dot ('.').
- (?:pattern) - match the pattern without storing the match).
- [dD] - any character in the set ('d' or 'D').
- [xX]? - any character in the set or none.
- ('x' may be missing so 'doc' or 'docx' are both accepted).
- | - either the previous or the next pattern.
- $ - end of matched string.
regex/file_types.1748331170.txt.gz · Last modified: 2025/05/27 07:32 by peter