Could someone lead me on finding a regular expression that blocks a comma separated list of Spam words I already have?
The regular expression needs to match a string with the spam word list I already have.
Not that it matters, but I am using PHP.
Could someone lead me on finding a regular expression that blocks a comma separated list of Spam words I already have?
The regular expression needs to match a string with the spam word list I already have.
Not that it matters, but I am using PHP.
Try this:
\b(word1|word2|...)\b
The \b
will match between a word character and a non-word character (so that the expression won't match if the words appear as part of a longer word).