procmail
[Top] [All Lists]

Re: Weird regex match?

2009-04-21 00:22:03


Nick Sharp wrote:
^X-FunderID: (1|4|8|9|10|11|13)

The above seems to match the above plus;
X-FunderID: 12
X-FunderID: 14
X-FunderID: 1x (x being anything)
X-FunderID: 4x X-FunderID: 8x
etc

How can I make it match exclusively the numbers without anything after?

It's matching that because you don't have an end anchor or another character to tell it that that is the end of the numbers. So if it's matching "X-FunderID: 15" what it's actually matching is "X-FunderID: 1" It takes the 1 from the string "15" and matches up to that point. To get it to only match the numbers you've specified, write it like this:

* ^Subject: .*\[SOMETAG\].*|^X-FunderID: (1|4|8|9|10|11|13)$


Full line is (in case something else is the problem)
* ^Subject: .*\[SOMETAG\].*|^X-FunderID: (1|4|8|9|10|11|13)


Nick


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail


Adrian
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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