-
within character class is used for representing a range
To treat -
literally in character class it can be at the beginning or end
With _-.
you are representing a range of 95
(decimal equivalent to ascii _) to 46
(decimal equivalent to ascii .) which is invalid.
Use this regex
[-_.]