XF 1.4 Help with Regex for spam phrase.

tafreehm

Well-known member
Hey there, I wanna create a rule where multiple words are found in a post it triggers the spam action. I entered this
Code:
/(word1|word2|word3|word4\w*|word5)/i

How can I set this where all words needs to be present in the message in any order. Right now, it return true when one of them is found.

Regards,
 
Off the top of my head, something like:
Code:
/((word1|word2|word3|word4\w*|word5).*){5}/siU
It's not perfect because it could match word1 5 times and none of the others. If you really want to require all 5 (or more words) words, you'd probably be better doing it with an add-on.
 
Off the top of my head, something like:
Code:
/((word1|word2|word3|word4\w*|word5).*){5}/siU
It's not perfect because it could match word1 5 times and none of the others. If you really want to require all 5 (or more words) words, you'd probably be better doing it with an add-on.
seems to be working ok. thanks
 
Back
Top Bottom