• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 Help with Regex for spam phrase.

tafreehm

Well-known member
#1
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,
 

Mike

XenForo developer
Staff member
#2
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.
 

tafreehm

Well-known member
#3
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