I want to test if a img filename (jpg) is valid in PHP. The files should look like this:
test-file.jpg
test-123-test.jpg
123-456-thumbnail.jpg
I tried the following regex:
([a-z0–9-])+.(jpg)
It works fine, but still allows filnames like "test--123----.jpg", but I just want to allow one "-".
Any idea how to solve this?