I would really appreciate it, if somebody could help me out with my regular expression for ProFTPd’s PathAllowFilter.
This is the regex I have so far: (.mp3|.aac|.m4a)$
Which allows only mp3s, aac, and m4a filetypes. But I would like to include the following, the filename may contain A-Z, a-z, 0-9, -, _ And the file-ending should be as stated above mp3, aac, and m4a, but it should be also allowed that it doesn’t contain any extension.
So now is my thought, how can I all combine this in one regex? Maybe you guys have some good ideas 🙂
Thanks ahead..
Try this regex:
This requires the filename to contain only the symbols you listed (note: the
-sign is at the end, so that it doesn’t work as a meta-symbol), and the?makes the extension part optional.