---- Phil Pennock <Phil.Pennock@???> wrote:
> On 2001-03-13 at 09:32 -0500, Tony Byers gifted us with:
> > I'm trying to write a director that will match a class list like
> ss01-cse-498-1@???
> > I've tried quite a few combinations but nothing seems to work.
> I thought
> > this might work
> >
> > new_address = ${if match{$local_part}{....-.+-.+-.+}{one}{two}}@???
> >
> > where one and two will actually need to be database lookups eventually.
> > I also need to distinguish between the above example and cse-498
> and
> > cse-498-1 and ss01-cse-498 so I need to recognize if it starts with
> > exactly 4 characters or if it contains three or four parts separated
> > by hyphens. If anyone has any advice on how to match the new_address
> > line above, it would be much appreciated.
>
> Read section 8.1 of the Exim Specification.
>
> Read doc/pcretest.txt
>
> Then run pcretest.
>
> This: /^....-[^-]+-[^-]+-[^-]+$/
> which becomes for Exim: ^....-[^-]+-[^-]+-[^-]+\\$
> seems to match what you specify quite well.
> --
> Just remember, violence is the last resort of the incompetent.
> The rest of us don't wait until it's the only option. -- R
>
I changed the line to:
new_address = ${if match{$local_part}{^....-[^-]+-[^-]+-[^-]+\\$}{one}{two}}@???
and I get this error in the log
2001-03-13 10:00:47 14cqI2-0003Cb-00 Expansion of ${if match{$local_part}{^....-[^-]+-[^-]+-[^-]+\\$}{one}{two}}@???
in special_dir director failed: $ not followed by letter, digit, or {
Tony Byers
___________________________________________________________________
To get your own FREE ZDNet Onebox - FREE voicemail, email, and fax,
all in one place - sign up today at
http://www.zdnetonebox.com