At 16:25:26 -0600 on Tue, 19 Feb , David critiqued:
| [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. If you'd escaped the braces, then I'd
be all for it.
David, I'm beginning to see where you're coming from. (I think)
Being based on egrep, procmail currently takes a backward step wrt grep (and
other POSIX 1003.2 tools):
man [e]grep:
REGULAR EXPRESSIONS
...
{n} The preceding item is matched exactly n times.
{n,} The preceding item is matched n or more times.
{,m} The preceding item is optional and is matched at
most m times.
{n,m} The preceding item is matched at least n times, but
not more than m times.
...
In egrep the metacharacter { loses its special meaning;
instead use \{.
<<<
At 14:48:16 -0800 on Tue, 19 Feb, Bart solved the conundrum artfully:
# 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.
I'm rather hoping that Philip is more entertained intellectually by the
longhand
aaa(a(a(aa?)?)?)?
than inclined to treat it as a really practical alternative to the posix
a{3,7}b ;-)
How convenient it would be to move between tools which use POSIX 1003.2
modern REs. Is there any goal for procmail to be in the club?
Regards,
Erik
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail