procmail
[Top] [All Lists]

Re: simple body parse

2000-11-20 13:25:56
Joel Dudley wrote:
SHELL=/bin/sh
                                Good idea.

:0fbw
| sed 's/usazdolmon0//'
                                ...deletes all "usazdolmon0"s
                                but leaves trailing spaces 

:0 B:
* \/ usaz*
{ CRYPT=$MATCH }



        http://www.procmail.org/jari/pm-tips-body.html#explaining__and

Besides that, you're matching 'usa', followed by any number of 'z's --
is this what you want?  Or do you want 'usaz' followed by any number
of non-(space,tab)?

If you want "usa plus any number of 'z's" then

     :0 B:
     * ()\/ usaz*
     { CRYPT=$MATCH }

should do it for you.  If you want "usaz plus any number of nonblanks" 
then

     :0 B:
     * ()\/ usaz[^      ]*
     { CRYPT=$MATCH }

(For "plus one or more nonblanks" change the trailing '*' to a '+'.)

Oops, I just noticed that the recipe puts a leading space character
into CRYPT.  Are you guaranteed that there's a space there -- that the
'usazz' word doesn't appear at the absolute beginning of the line, for 
example, or that it never immediately follows a TAB character?

hth
-- 
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.  Sorry.
Collin Park                         Not a statement of my employer.
_______________________________________________
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>