procmail
[Top] [All Lists]

Re: Checking a match for numbers

2017-08-23 13:57:10
Kreemy wrote:

I want to check the contents of a variable for "too many" numbers

I'm sure there's a clever way with a weighted or match

something along the lines of "more than 4 numbers and more than 20% of
the characters"

Let's see ...

# If the number of digits is more than 4, continue and don't skip.
:0
* 1^1 VARIABLE ?? [0-9]
* -4^0
{
 # Fetch previous score and add back 4 to get digit count again;
 # then subtract 1/5 the length of the variable.
 :0
 * $=^0
 * 4^0
 * -.2^1 VARIABLE ?? .
 action
}

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)rwth-aachen(_dot_)de
https://mailman.rwth-aachen.de/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>