Gossamer Forum
Home : General : Perl Programming :

perl regex help

Quote Reply
perl regex help
hello!

i'm thinking of adding another filter to spamassasin to catch spam with relly long subjects.

what I want to do is return true if the number of characters is over 150 long - does this look correct?

Code:
/\w{150,}/


regan

Last edited by:

ryel01: Apr 22, 2004, 8:09 PM
Quote Reply
Re: [ryel01] perl regex help In reply to
I've not really played with SpamAssasin much, but can't you use length() ?

Code:
length($var) > 150

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] perl regex help In reply to
hi andy - it's actually going in one of the settings files used by mimedefang, not spamassassin, and that uses regular expressions to match against. You basically just specify which part of the message to match against, supply the regex to use, and allocate a score if it matches. So my regex is just to say if it's over X number of characters then return true for positive match.