Re: [exim] Regex Help and Optimization

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Marc Perkel
Fecha:  
A: John Jetmore
Cc: exim-users
Asunto: Re: [exim] Regex Help and Optimization


John Jetmore wrote:
> On Tue, 3 Jul 2007, Marc Perkel wrote:
>
>> Heed a little regex help. I'm trying to grab the final domain part of a
>> string:
>>
>> ${sg{$sender_host_name}{\N^.*\.(.*\..*)$\N}{\$1}}
>>
>> And this works - but it hits on *.domain.com and misses domain.com
>>
>> How would I modify this to match domain.com too? Thanks in advance.
>
> ${sg{$sender_host_name}{\N^(?:.*\.)?([^.]*\.[^.]*)$\N}{\$1}}
>


Thanks - I got it working.