Author Topic: Lots of spambot accounts?  (Read 28229 times)

Azerax

  • BM Dev Team
  • Mighty Duke
  • *
  • Posts: 1521
    • View Profile
Re: Lots of spambot accounts?
« Reply #15: August 10, 2012, 03:26:45 PM »
Well, let's give it a day or two and see what happens. I'm not all that good with regexes.

This will match only the last 2 digits if they are numbers:

/[0-9]{2}$/

So it may look like this:
Code: [Select]
$username="fish23";

if (preg_match_all('/[0-9]{2}$/i', $username, $result)==1)
{
echo "Match found";
}
else
{
echo "no match found";
}