Re: Checking a match for numbers

"David W. Tamkin" <[email protected]> Wed, 23 Aug 2017 13:53:42 -0500
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
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
  * $=3D^0
  * 4^0
  * -.2^1 VARIABLE ?? .
  action
}