I have a string that users can enter on the Internet, it is currently not protected against XSS attacks. I would like to be able to replace <and> characters. Commonly known as less, more, angle brackets, etc.
I'm sure this has been asked millions of times, but I cannot find a simple answer. I assume that regex is the way forward, but cannot decide how to select these characters.
source
share