procmail
[Top] [All Lists]

Re: regex to detect 20+ characters

2010-08-17 13:55:34
Re: regex to detect 20+ characters 

Hi Dennis
Thanks for your solution, but I can't get it to work (I'm rather new to 
procmail) I suspect the problem is with the syntax of the rest of my recepe.  
For testing purposes I reduced 20 to 10 characters.  I also simplified 
[a-zA-Z0-9] to [a-z] i.e. just testing with lower case strings of characters, 
while I figure this out.

You kindly provided this:  Subject:.*[a-zA-Z0-9]{20,}
So while testing I'm using this:  Subject:.*[a-z]{10,}

My recepe should divert matches to a junk mailbox and ignore non matching 
emails.  I adapted another working recepe and tried to incorporate your 
solution.  Here is what I used, I suspect I'm doing the wrong thing with the 
braces { }.  Any help much appreciated:


:0
* Subject:.*[a-z]{10,}
{    EXITCODE=99
  :0 i
  ! junk(_at_)example(_dot_)com
}


I've also tried it with    * ^Subject.* 

Andrew


Dennis wrote:

From: Dennis  
Date: 14 August 2010 05:36:59 AM GMT+01:00
To: Andrew
Subject: Re: regex to detect 20+ characters (banan)


The regex should actually probably be something like

Subject:.*[a-zA-Z0-9]{20,}

I.e. with the ".*" added, so that any 20+ alpha-numeric string in
the subject will trigger the rule. Without the ".*", it would only
trigger if the first word in the Subject was 20+ characters :\.


On Sat, 14 Aug 2010 01:42:38 +0100, ProcMail wrote:
Thanks!!
I'll try it. 
Andrew


On 13 Aug 2010, at 02:34 AM, Dennis wrote:

On Thu, 12 Aug 2010 17:37:41 +0100, Andrew wrote:
Hi
Any help, much appreciated.
Re. regex to detect more than 20 alphabetic characters without a
space in the subject of an email

I'm stuck. I've been searching for how to write a regex for
procmail to detect a string of more than 20 characters without a
space in the subject of an email.
To be more precise:
- 20 or more characters (alphabetic or numeric),
- Ignore if the string contains a space,
- Ignore if the string contains: @, /, -, _  (i.e. ignore email or
web addresses).

Subject: [a-zA-Z0-9]{20,}

:)
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
<Prev in Thread] Current Thread [Next in Thread>