Mark any form text containing any period concatenation

Hi everyone,

I need to block any form message containing a period in between two strings, for example “,,”. I’m getting extremely inappropriate spam submissions containing out of the ordinary domain TLD extensions (.tc, .ally, .am). I think blocking anything text with period in between any two strings would be the best solution.

I am already blocking form submissions that contain http and https, however these spam submissions are not including http:// or https://, so blocking http/https is not sufficient. I would need to block anything with a period in-between two strings.

Upon my research, it looks like I need to add a block of code into the functions.php file. Could anyone provide me with a template I can work with? I’m relatively new to regex, so any guidance would be very much appreciated.

Thank you!