forum post validation regex
Posted: Tue Jul 11, 2006 2:56 am
Hi,
I'm trying to filter out spam on my forum. I added two tables to my db. One is spamwords and another called spamAlphabet.
The spamAlphabet contains records like:
a aàáâåãäæ\@
b b6
c cç6
d db
e eéèêë3
f f4
g qgp9
h h4
i iìíîï¡1\|l\!
j ji1
which I use to construct a regex expression using a stored procedure in Sql.
Using the above substitution, the word "tour" becomes
/[t7\+][\\W]*[o0óòôøõö(\(\))\*\.][\\W]*[\\W]*[r]/gi
Essentially, I would like to find any form or shape of the word "tour", even if there is punctuation or white space between the letters.
Is the specific resulting regex that I'm using in the correct syntax to trap these sort of occurances? If not, please write how I should change it.
Thanks in Advance
Joshua
I'm trying to filter out spam on my forum. I added two tables to my db. One is spamwords and another called spamAlphabet.
The spamAlphabet contains records like:
a aàáâåãäæ\@
b b6
c cç6
d db
e eéèêë3
f f4
g qgp9
h h4
i iìíîï¡1\|l\!
j ji1
which I use to construct a regex expression using a stored procedure in Sql.
Using the above substitution, the word "tour" becomes
/[t7\+][\\W]*[o0óòôøõö(\(\))\*\.][\\W]*[\\W]*[r]/gi
Essentially, I would like to find any form or shape of the word "tour", even if there is punctuation or white space between the letters.
Is the specific resulting regex that I'm using in the correct syntax to trap these sort of occurances? If not, please write how I should change it.
Thanks in Advance
Joshua