• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

Simple regular expression for a spam filter

I need a regular expression for a spam filter. Basically, I’m receiving particularly annoying spam from varying address, but with pretty characteristic title content, and I could reject emails based on this title pattern.

The titles are in the form of:

GreatAdobbeAndCoorelDdeals-BuyWith70%DicosuntAndStartDownlaoadingRightAway
Hi-SpeedAnddHhassle-FreeDowwnloadOfAllMacAndPPCSotwfare
NewOfifice2010IsGgeraterThhanEveer.OrdeerItFrommLeaidngOnilneResseller
GreatDealsOnMuisicBBruinng&EdtiingSofftwaare-SaaveUpTo70%.FamuousSoftwarreOuutletSince2002
LoooikinngForGenuniuneDiscouunttedSoofttware?HereIsTheRightPlace

so it should pretty easy to crate a RegEx for them, but I have no experience in this area.

So, the RegEx should mach the following criteria:

-The string contains at least 50 characters (letters, digits, signs)
-The string does not contain space


Thanks
0
npaun
Asked:
npaun
1 Solution
 
MacAnthonyCommented:
Try this:
if( preg_match('/^[^ ]{50,}$/i',$title) == 1 )
     // do something

Open in new window

0
 
eugenbvCommented:
try .[^ ]{50,}
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now