procmail
[Top] [All Lists]

Re: multi-line matching

2002-05-29 11:09:27
Jim Raney asked,

| I have a file that I've loaded into a variable that contains data in this
| format:
|
| group1(_at_)example(_dot_)com: user1(_at_)example(_dot_)com 
user2(_at_)example(_dot_)com
| group2(_at_)example(_dot_)com: user3(_at_)example(_dot_)com 
user4(_at_)example(_dot_)com
|
| What I need to do is grab everything to the right of the colon from each
| individual line.
|
| :0
| * RECIPS ?? ^.*:\/.*
|
| seems to get the first line OK.  ...
| ...  From what I've been reading the procmail regex
| engine is supposed to be multi-line but I can't quite figure out how to
| get both (or more) lines into $MATCH.  Can anyone give me a pointer?

MATCH extracts a contiguous string from the search area.  It can be
multi-line, but it can't skip over pieces in the middle 
("group2(_at_)example(_dot_)com:"
in your illustration) and then grab more text later on.

If you want the right sides of all the lines in one variable, you'll need to
use some outside program, such as sed or awk or perl (or less efficiently,
piping grep to cut).




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

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