procmail
[Top] [All Lists]

Different result with ()\/^.*string and ^\/.*string

1997-11-18 15:28:24
Another match anomaly. This one occured in my rc, and I was able to
reproduce it in a smaller environment for all to see. This behaves the
same under both v3.11pre4 and v3.11pre7.

With the following test rc:

# $Id: pmtest.rc,v 2.17 1997/11/14 22:32:01 rik Exp rik $
   SHELL=/bin/sh
   MAILDIR=$HOME
   DEFAULT=|
   CRLF="
"
  :0HB
  * \\/^.*abc
  { LOG="  With \\/ before, caught $MATCH$CRLF" }
  :0HB
  * ^\/.*abc
  { LOG="  With \\/ after, caught $MATCH$CRLF" }
  :0
  /dev/null

and the following invocation:

$ echo "123 

abcd
ghi" | procmail ./pmtest.rc VERBOSE=yes

I get the following result, which I cannot understand:

procmail: [4135] Tue Nov 18 17:09:48 1997
procmail: Assigning "MAILDIR=."
procmail: Rcfile: "./pmtest.rc"
procmail: Assigning "SHELL=/bin/sh"
procmail: Assigning "MAILDIR=/u4/rik"
procmail: Assigning "DEFAULT=|"
procmail: Assigning "CRLF=
"
procmail: Assigning "MATCH="
procmail: Matched "abcd"
procmail: Match on "\\/^.*abc"
procmail: Assigning "LOG=  With \/ before, caught abcd
"
  With \/ before, caught abcd
procmail: Assigning "MATCH="
procmail: Matched "abc"
procmail: Match on "^\/.*abc"
procmail: Assigning "LOG=  With \/ after, caught abc
"
  With \/ after, caught abc

Note in particular the trailing character caught in the match. The same
result obtains when the leading \ in \\/ is changed to ().

Any takers?

-- 
Rik Kabel          Old enough to be an adult              
rik(_at_)netcom(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>