I'm trying to create a Regex to block all < and > in a String except when used with <select>.
Can anyone suggest a Regex for that? I'll be using it with javax.util.Pattern.
I'm trying to write a solution to block the injection attack and XSS attempts through request and URL. For that, I'll be blocking the special characters and character sequences but with some exceptions. One of the exception is that, I have to allow < select > (angle brackets with select in between them) because that is passed into the request legitimately in some of the cases. But all other combinations of angle brackets have to be blocked. And that is the reason of my question.