Re: [exim] nwildlsearch

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: John Burnham
Dátum:  
Címzett: 'Klaus Ethgen', 'exim-users@exim.org'
Tárgy: Re: [exim] nwildlsearch

> Hello,
>
> am I right with that nwildlsearch will search for the _begin_
> of the key
> in the lookup and that I have to use "^...$" to be sure that
> I match the
> full string?
>

No.
lsearch is a linear search and simply searches for the key given and returns the data associated with it.
>From the docs:

lsearch: The given file is a text file that is searched linearly for a line beginning with the search key, terminated by a colon or white space or the end of the line. The search is case-insensitive; that is, upper and lower case letters are treated as the same. The first occurrence of the key that is found in the file is used.

White space between the key and the colon is permitted. The remainder of the line, with leading and trailing white space removed, is the data. This can be continued onto subsequent lines by starting them with any amount of white space, but only a single space character is included in the data at such a junction. If the data begins with a colon, the key must be terminated by a colon, for example:

baduser: :fail:

The "wild" part of nWildlsearch simply means that you can put a wildcard in the lookup key and the "n" part just means that no string expansion of the key takes place. You can use regular expressions by beginning your key with a circumflex but it's not necessary.

For example, from the docs:

*.a.b.c       data for anything.a.b.c
*fish         data for anythingfish
^\d+\.a\.b        data for <digits>.a.b


The documentation will probably explain it better - check out:

http://www.exim.org/exim-html-current/doc/html/spec_html/ch09.html

John