procmail
[Top] [All Lists]

Re: how to match a word in body ?

2002-07-24 11:28:12
Michael asked,

| how can I match a word in the body (some text ThisWord some text)
| and pipe this word to a Program ?

Oh gosh.  Can you be sure that the word will have a spaces afte it, or will it
possibly be at the end of a line, or might there be a punctuation mark after
it?  Is it a literal word that has only letters of the alphabet in it?

 :0Bi
 * ()\<\/pattern to match the word\>
 * MATCH ?? ()\/[a-z]+
 | echo "$MATCH" | program

If there can be non-ASCII letters (such as German umlauted vowels or long
double s) in the word, adjust the bracketed range on the third line
accordingly.  Leaving the `D' flag off the flag line will allow for
case-insensitivity on straight Roman characters, but you might need to specify
both upper and lower case forms of non-ASCII letters, like this (if you're
reading in the same character set that I'm using for typing):

 * MATCH ?? ()\/[a-z篦扤燧\xDC]+



_______________________________________________
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>