| |||||||||||||||||||||||||||||||
|
> Christopher Mahmood wrote: >> * Wietse Venema (wietse) [070411 16:45]: >> >>> jdebert: >>> >>>> X-pstn-levels: (S: 0.00000/96.74935 R:95.9108 P:95.9108 >>>> M:97.0282 C:98.6951 ) >>>> >>>> I want to evaluate the first number before the slash which is >>>> variable, ranging from 0.00000 to 99.99999 and somehow arbitrarily >>>> set a maximum number below which the message will be discarded. >>>> >>>> Can this be done with pcre? I am having trouble working out how to >>>> define an arbitrary numeric range. >>>> >>> To discard 0.* .. 29.* and less: >>> >>> /^X-pstn-levels:\s+\(S:\s+[1-2]?[0-9]\./ discard >>> >> >> Almost, there's no space after 'S:' when >= 10: >> /^X-pstn-levels:\s+\(S:\s*[1-2]?[0-9]\./ discard >> For what it's worth, 1.0 is a fairly aggressive threshold. >> > > and if the scores come in a different order: > /^X-pstn-levels:.*\WS:\s*[1-2]?[0-9]\./ discard > > > > Of course! I was thinking in regexp, not pcre. Caffeine is no longer working. Time to reconsider alternating current. -- jd A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?
| ||||||||||||||||||||||||||||||
© 2004-2008 readlist.com