procmail
[Top] [All Lists]

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

2002-02-19 15:54:06
On 19 Feb, David W. Tamkin wrote:

[referring to {m,n} RE syntax and why it would have to be \{m,n\} if
implemented in procmail]

| [...]  For one thing I can never remember which is the better way
| to write this stuff currently.  Philip has often explained why, for
| a\{3,\7}, it's not efficient to write
| 
|  aaaa?a?a?a?
| 
| but I can't for my life remember which way he says is best.  Is it
| 
|  aaa(a(a(aa?)?)?)?
| 
| I think?
| 

You think correctly. I know only because he said so 5 days ago and it's
still in my inbox awaiting my decision where to file it (so I'll find
it when I need it). I don't have the url from the archive but here is
the relevant excerpt:

|       From: Philip Guenther <guenther(_at_)gac(_dot_)edu>
|    Subject: Re: Matching Special Characters
| Message-id: 
<200202140656(_dot_)g1E6uvh09687(_at_)callisto(_dot_)gac(_dot_)edu>
| 
| [...]
| You can do ranges using multiple nested paren expressions with '?', so
| instead of writing, for example, "a{3,7}" you would write:
|       aaa(a(a(aa?)?)?)?
| 
| (Nesting the parens makes it more efficient to process than the simpler
|         aaaa?a?a?a?
| as it eliminates duplicate means to matching a given number of
| occurences.)


-- 
Reply to list please, or append "6" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.


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