procmail
[Top] [All Lists]

Re: Suggestion for Enhancement; B, H, ... and D

2002-02-19 15:51:51
On Tue, 19 Feb 2002, David W. Tamkin wrote:

|    To have any chance of winning over the proponents of "funny regex",
| procmail's missing {n,m} functionality would probably need to be added to
| the limited * and +. i.e.:
|
|    [A-Za-z]{3}    # Exactly 3 case insensitive characters
|    [A-Za-z]{3,}   # 3 or more case insensitive characters
|    [A-Za-z]{,4}   # Up to case insensitive characters
|    [a-z]{3,7}     # 3 to 7 case sensitive characters

Not nearly so silly as the former, but still somewhat, and the reason is the
same.  If a range of how many matches to allow is ever implemented, the
braces will have to be backslash-escaped to avoid misunderstanding older
rcfiles where a brace meant a brace.

This is why I suggested adding a flag to mean "extended syntax ahead" --
for example:

        # In this rule, we mean "Subject:" followed by 0 or more "s",
        # then any one letter and then brace three comma seven brace.
        # (The backslash is extraneous, but we have to support it.)
        :0
        * Subject:\s*[a-z]{3,7}

        # In this rule, "Subject:" followed by 0 or more whitespaces,
        # then between three and seven of any character.
        :0X
        * Subject:\s*[a-z]{3,7}

Older rcfiles would lack the "X" flag so procmail would know to apply the
old rules.  The new rules could be anything, even perl-compatible REs.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail