Can't enter watched words regex to catch phone numbers

Hi!

We’re experiencing a lot of spam that’s not caught by Akismet. The messages usually have (international) phone numbers in them which made us think of using a regex to catch them.

After experimenting a bit we found the following expression:

(?:\+|00)?\d{1,3}?[-\s]?\d{2,4}[-\s]?\d{2,4}[-\s]?\d{2,4}|\b\d{10}\b

We’re not able to enter this though as the admin screen breaks it up into separate chunks:

Any suggestions how we should handle this?

I think it’s picking up on the pipes | when the regex is copy-pasted in. I think if you type it in manually it may ignore them as separators and allow you to do it as one entry. :crossed_fingers:

ETA: From a quick test, this seems promising. :+1:

3 Likes

Brilliant, that solved it! :+1:

3 Likes