I already gone through some question in StackOverflow regarding this but nothing helped much in my case.
I want to restrict the user to provide a filename that shoul
For full character set (Unicode) use ^[\p{L}0-9_\-.~]+$
^[\p{L}0-9_\-.~]+$
or perhaps ^[\p{L}\p{N}_\-.~]+$ would be more accurate if we are talking about Unicode.
^[\p{L}\p{N}_\-.~]+$
I added a '~' simply because I have some files using that character.