procmail
[Top] [All Lists]

Re: bug: overoptimizing RE

1998-01-21 15:58:54
I wrote,

| Note that this would have given a non-null value to MATCH:
| 
|  ^Subject:.*Keywords\/.*[0-9]*
| 
| With the ".*" after "Keywords" moved to the right, it becomes greedy and
| reaches all the way to the digits, and MATCH="<space>9999".

Correction: the second ".*" would have reached not just up to the digits but
through them to the end of the line.  If that regexp were matched with this
subject,

  Subject: Keywords-- I have 9999 reasons to bite your nose.
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
or this one, which contains no digits,

  Subject: Keywords, keywords, keywords all over the place!
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MATCH would contain what I've indicated, all of it matched to ".*" plus null
matched to "[0-9]*".

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