[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Procmail regular expression: word end boundary matching



T o n g wrote:
> I seems not able to get the word end boundary matching for procmail 
> works. Here is my test rc file:
> 
> :0 HB
> * 1^0 \<test\>
> * 1^0 test
> /dev/null
> 
> and there is a ' test ' in my test email. 
> 
> However, from the dry run log, I can see that '\<test\>' did not match 
> yet 'test' did. 

I think it is a bug in the \< expansion.  Try this with one extra
backslash in front of the left < only.  Not the right > one.  Only the
left one.

:0 HB
* 1^0 \\<test\>
* 1^0 test
/dev/null

> 2. About word end boundary matching, I found the following from the web:

That documentation is in the procmailrc man page.

> \<
>     A shorthand for the character class [^a-zA-Z0-9_] except it can also 
> match newlines. 
>     This is an incompatible imitation of the "word end boundary" operator 
> found in some extended regular expression implementations. Note that \< 
> and \> are actually identical. 

I think that is outdated because from testing the above the
documentation in the man page doesn't seem to match the behavior.  I
think the ERE engine may have been swapped out for a different one
after the documentation was written.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: