Re: [Exim] PCRE regex

Pàgina inicial
Delete this message
Reply to this message
Autor: Tamas TEVESZ
Data:  
A: exim-users
Assumpte: Re: [Exim] PCRE regex
On Fri, 11 Apr 2003, Kirill Miazine wrote:

> > re> /(^.[^/]*)(/InfoTL\.RZV)@vit.de/


completely on a side note, if i understand what you're trying to do,
i'd give a thought of using []+ vs []*. []+, when results correctly
tested, would give you some protection against possible screwed up
names, 'cause []+ wouldn't match for null parts and the like, should
you have some hiccups (hey, you never know with lotus!).

re> /^([^_]+)_([^\/]+)\/InfoTL\.RZV@vit\.de$/
data> Michael_Jakscht/InfoTL.RZV@???

0: Michael_Jakscht/InfoTL.RZV@???
1: Michael
2: Jakscht
data> _/InfoTL.RZV@???

No match
data>

whereas:

re> /^([^_]*)_([^\/]*)\/InfoTL\.RZV@vit\.de$/
data> Michael_Jakscht/InfoTL.RZV@???

0: Michael_Jakscht/InfoTL.RZV@???
1: Michael
2: Jakscht
data> _/InfoTL.RZV@???

0: _/InfoTL.RZV@???
1:
2:
data>

depending on what you exactly are trying to do, might worth it.

ps. isn't this pcretest cool. i knew its there, but i've never used it
much. i'm starting to see that was a pretty big mistake on my part ;)

--
[-]
... and the rest is silence.