I was working on a regex to check if all the symbols in the string are from the range of allowed ones.
My initial regex, which was working was:
Later I decided to allow spaces and dots and wrote a new regex:
This one was not working! I’ve spent quite a time until I figured out that the peace “_-\.” was treated the same way as “a-z”. It assumed I am providing a scope. My issue was fixed after I escaped “-” and my final regex looked like this: