procmail
[Top] [All Lists]

Re: Checking a match for numbers

2017-08-24 03:39:28


On 17/08/17 20:13, @lbutlr 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"

(A lot of mailers are now polluting the list-ID header with bullshit, and I 
want to detect that so I can discard the list-ID when it's garbage)


Start with this two following hints. The 20% must be simple too - but I have
math-phobia to figure out the score recipe.

(Note: maybe the score will not give you *_exactly_*  20%)

0:
* 1^1 .
{ all_chars=$= }

0:
*  -4^0
*  1^1  [0-9]
{ more_then4="yes" }


--udi
____________________________________________________________
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>