procmail
[Top] [All Lists]

RE: Searching for single word

2002-12-30 23:23:20
At 22:41 2002-12-30 -0500, Mike Chambers did say:
thanks. that go me a little further:

:0Bi
* ()\<\/(foo|FOO)\>

Are you using 'i' because it's fun, or is there some logic to it? Do you even know what it does, and why you'd ever use it?

however, this matches:

foo
FOO

What a surprise, seeing as that is the text you're specifying to match. Also, it'll match fOO Foo FOo FoO, etc.

as well as:

/foo/

Well, \< matches a wordbreak, and "/" isn't generally considered part of a word...

i want it to match

" foo "

(basically foo by itself)

If you expect _spaces_ on either side as delimiters, then specify spaces on either side. Seems pretty simple.

as well as when it is at the beginning or end of line.

Something like this might do ya:

:B
* (^| )foo( |$)

also, if (foo|FOO) necessary, or is the procmail matching case
insensitive?

You might consider reading all the responses to your query.

[double snip]

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


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