I'm performing input validation in java using ESAPI.validator().getValidInput method call to prevent XSS attacks in POST requests.
I am sending my json string to this method to validate against a regex.
My ESAPI regex is as follows:
Validator.SafeStringSpcCharacters=(?u)^[.\\p{Alnum}\\p{Space}*,()&+!@#$%^_={}:";'?~`|\\[\\]\\\\\/-]{0,2147483647}$
Please advice for a valid regex to prevent XSS attacks in json string.