Looking for a PHP regular expression or function to filter options. Email Security

I get spam due to gmail, allowing use . in their letters, so someone likes this spammer.

q.i.n.ghu.im.i.n.g.o.u.r@gmail.com 

may go through the removal and / or addition of another period to its naming structure. This happens on a Joomla installation, so I’m specifically looking to create a component, so I can add it to several sites, or if there is a simple regular expression to add embedded existing code. Also, is there anything about this, as it looks like it is called β€œstrong,” not called. This is crazy for me.

+7
source share
2 answers

If your goal is to match this address with others that are equivalent to it (because you already got them on the black list), I would simply normalize the address to its main state before saving it. In lower case, divide it by @, and if the right side is "gmail.com", then delete all the dots on the left side and return the halves together.

  • start with JOE.SCHMOE@GMAIL.COM
  • lower case for joe.schmoe@gmail.com
  • Share on joe.schmoe and gmail.com
  • since the right side is gmail.com, it removes the dots on the left.
  • collect on joeschmoe@gmail.com

Now you have a base address that you can block / deny / independently.

+4
source

You can do something simple: /^(?:[^@]+\.){5,}[^@] +@ (?:[^@]+\.)+[^@]+/

This is just a quick throw, not intended to be checked, but rather a pointer indicating whether their email is sketchy. The key point here is the quantifier {5,} , which says that if the letter has 5 or more points (for example, abcdef ), it will match. In other words, it should be noted as fragmentary.

Hope this helps!

Explanation: http://regex101.com/r/lB5vG3

+2
source

All Articles