Based on your criteria, this should work.
^[[:alnum:]_]+\.jpg$
and after the edit requested:
^[[:alnum:]_-]+[^-0-9x]+\.jpg
and after the second edit requested:
^[[:alnum:]_-]+[^x]{5}\.jpg
I don't have Filezilla installed at the moment, but Filezilla uses POSIX regular expressions. This means we can't use lookaheads, but that shouldn't be a problem.
The expression uses a character class [[:alnum:]_]
with a quantifier, allowing it to match any number of letters, digits and underscores. Then we match a period, jpg and the end of the string, so any suffix using a dash will fail.
In the second expression, before the .jpg
, we make sure to match any number of characters that are not dashes, digits or xs.
In the third expression, the [^x]{5}
is a bit of a hack: it ensures there is no "x" character in the last five characters, therefore excluding files ending in 300x225.jpg
for instance. This would also exclude some false-negatives, such as myphotox.jpg
as well as short files such as abc.jpg
One way to get around the short file problem is, which accepts all four-letter filenames that don't include xs. Still a hack.
^[[:alnum:]_-]+[^x]{5}\.jpg|^[^x]{1,4}\.jpg
If there are exceptions, let me know so we can tweak the regex.