I maybe wrong, but it may be related to this
From this commit:
And the fact that
- may need to be escaped like
. is. Alternatively, if you list
- at the very end, it should work too but being between two characters, it thinks it is trying to define a range.
/^[a-zA-Z0-9\._-]+$/ should work
Also, I think it would be better to make the test, use ‘test_Site-0123456789.tar.gz’ so that it utilizes all of the characters you are permitting.