My asp.net mvc application uses angujar js has following regular expression to block XSS data in the input fields.
^[^&<>\\\\\"'{}=#]*$
But the problem is, most of my customer data has & and # and it cannot be corrected. Please explain the best possible way to allow these two characters and still block XSS attacks.
EDIT 1 Can I try something like this, suppose if I allow & and # and add validation in such a way that only one & is allowed or only one # is allowed and either & or # are allowed but not both and restrict if these characters are more than once. I will place this validation on both client and server side. Is this a good approach ?