I'm trying to check the textarea submitted in a form to see if it contains any url's. There are many posts here, and elsewhere, that deal with this. The accepted method seems to be to use regex. This is the code I am using, though I've tried many of the others I've ran across.
(/(\b(((https?|ftp|file|):\/\/)|www[.])[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/i)
In almost all cases, the above works. But emails are still getting through that contain something like this:
_a href="http://example.com/"_online casino games_/a_
If I try submitting the form with the above in the message, the code identifies it, as it should. But, somehow, spammers are still getting them through. A few of the posts I've read on this subject said it was not possible to catch all instances due to the possible ways to enter the url's. I'm assuming these get by due to the _a but since it works when I try it, I've no way to troubleshoot it. Does anyone know how to stop these?