This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
hi, how can I filter out html tag in user input in validator?
I used the following code(this code actually is for the opposite case, say, true if the input has "<xxx>" substring. The reason is so far I don't know how to write the desired regular expression, "not-<xxx>"):
But the validator reports error, saying this is not well-formatted. I know the problem is "<" in "<[^<>]+>". I tried the unicode of "<", as the following, no error reported any more, but still not working(can't validate true if input has html tag: <var><var-name>mask</var-name><var-value>^\u003c[^\u003c>]+>$</var-value></var>
Any one can help?
Joined: Jan 22, 2002
I solved this issue, as the following:
<![CDATA[ ^[^<]*[^>]*$ ]]>
This is not a strong solution, to detect html tags in user input, but so far good enough for me.
subject: filter out html tag in user input using validator