procmail
[Top] [All Lists]

Re: debugging \<(xxx|yyy|zzz)\>

2004-05-28 16:25:56
Jim Osborn followed up,

I'll assume you meant "* 1^1" :)

Yes, I did mean that. Thanks for catching it. What I didn't mean was everything to the right of there, because even with the typo corrected, it wouldn't have worked anyway. Forget I suggested it.

So, there's no way to put a pair of bounding regexps at the ends of a
list?

Of course there is; you already had it in the regexp you were trying. What there ISN'T is a way to count both of two overlapping matches to a regexp, unless the overlap consists of a single newline.

I've run into a very similar problem before, trying to count words where there was a chance that two of the words I was looking for might be separated by only a space. I don't remember finding a solution.

Sounds like each word in the list
has to have its very own word boundaries. :(

As Sean has already suggested, if you have control over the generating the string to be searched, make it put two non-word characters between each two words. Two spaces will do the job very well. Then your original

* 1^1 ()\<(word1|word2|word3)\>

will do the job. Another way would be to make it put one word out per line; then the above regexp would work and so would

* 1^1 ^(word1|word2|word3)$


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