procmail
[Top] [All Lists]

regexp question(s)

1998-07-01 10:32:48
I'm no expert on regular ecpressions, but I'm trying to come to grips with
what can or can't be done with them in procmail.  I hate spawing another
process, it something can be done internally.  In the features file it states
that procmail "Uses standard egrep regular expressions".  So using the man
pages from several operating systems as a guide I've tried to write a
recipe to find lines like:

        Subject: AB000000055449 etc...
        Subject: XYZ155449 etc...
        Subject: something... XYZ155449 etc...

where "AB" and "XYZ" will always be common no matter what the numeric portion
reads.  The best I've been able to come up with that works is:

        * ^Subject:.*(XYZ[0-9]+|AB[0-9]+)

but this does find lines I didn't want it to catch(ie Subject: AB3 etc...)
The following perl statement does exactly what I want to do(so far):

        /^Subject:.*(AB|XYZ)[0-9]{5,}/

but so far I haven't been able to get procmail to catch the lines with this kind
of statement.

What I'm looking for is what expressions procmail excepts.  Is their some
document I can go to that will tell me what procmail can/can't do?  What I read
in the egrep man pages would indicate that "[0-9]{5,}" should work(at least 
using
egrep on the systems I'm using).  I've check the archives but so far have not
been able to find anything that would tell me what I'm looking for.

Any good online documents?  Also if their is any place I could find advanced
examples of what procmail will do would also be appreciated.  If anyone can
show me how to rewrite the recipe I wont refuse that either.

Like the old saying: "Feed a man a fish, and you saved is life for a while.
Show him how to fish and you've given him a lifetime(or something to that
effect).  I want to learn how to fish, but I need the right tools!

Thanks in advance(and for putting up with long windedness),

Jim
-- 

| Jim Murphy                            | Lead Engineer (Systems & Network)  |
| Motorola C.I.G. (ITS P&I)             | E-Mail:  
murphyja(_at_)cig(_dot_)mot(_dot_)com             |

<Prev in Thread] Current Thread [Next in Thread>