To enhance security measures, I am looking to restrict users from inputting the following characters: ~ " # % & * : < > ? / \ { | } .
The key requirement is that all other characters should be permitted, while ensuring that only the specified characters are forbidden.
My current approach involves using the regex pattern below, but it inadvertently blocks certain valid characters like the exclamation mark (!) as well:
private static folderRegex = /^[A-Za-z0-9_-]+[ßüÜöÖäÄ\w]*$/;