I tried these regexps costume filters to block 11 digit mobile number spams:

/\d{11}/
/([\d]){11}/
'091'
'093'

But they cannot avoid spammer from posting the mobile numbers in comments. This is kind of frustrating because blocking phone spam is the most crucial expectaion that I have from Spam module. I greatly appreciate your hints.

Comments

AlexisWilke’s picture

Hi there,

This is probably not that easy. Can your phone numbers be written as in 06 12 34 56 78 (with spaces, dashes, periods, parenthesis...) Because I've seen many ways to write such numbers and catching them all is probably going to be a fun exercise, but you'll have new ones slip through all the time!

Your first expression works great with a number written such as 0612345678 (no spaces, dashes, periods...)

So, what exactly are you asking, really?

Thank you.
Alexis Wilke

marko3’s picture

Thank Alexis. You are right, it is very difficult to block all possible phone number formats. I checked again, and the system is capable of block numbers like 0612345678.

jeremy’s picture

There are many regexp formulas available online that can help you write your custom filters:

For example:
http://blog.stevenlevithan.com/archives/validate-phone-number

(It's not clear to me if your issue is the writing of valid regular expressions, or something else.)

marko3’s picture

Status: Active » Closed (fixed)