Re: [exim] Wrong regular expressione

Pàgina inicial
Delete this message
Reply to this message
Autor: Bill Hacker
Data:  
A: exim-users
Assumpte: Re: [exim] Wrong regular expressione
Tony Finch wrote:

> On Thu, 3 Nov 2005, Dennis Davis wrote:
>
>>On Thu, 3 Nov 2005, garlic wrote:
>>
>>
>>>From: garlic <astenax@???>
>>>To: exim-users@???
>>>Date: Thu, 3 Nov 2005 04:26:08 -0500
>>>Subject: [exim] Wrong regular expression
>>>
>>>I want check $local_part with follow regular expression:
>>>
>>>sms2email:
>>>driver = redirect
>>>allow_fail = true
>>>allow_defer = true
>>>domains = +local_domains
>>>#Correct or not follow string?
>>>condition = ${if match {$local_part}{^342345\d{4}$}{no}{yes}}
>>
>>See page 107 of the manual. You probably want to write:
>>
>>condition = ${if match {$local_part}{\N^342345\d{4}$\N}{no}{yes}}
>>
>>to ensure that the regular expression isn't expanded...not that I've
>>tested this...
>
>
> No you don't. Never use the condition precondition if there is a more
> specific precondition that does the job.
>
>     local_parts = ^342345\d{4}\$

>
> Tony.


Many thanks for that 'genral case' reminder, Tony!

- that helps simplify a whole bunch of *other* overly convoluted legacy
code for me.

Bill Hacker