Re: Postfix Regular Expressions

2002-04-14 Thread Bart-Jan Vrielink

On Sun, 2002-04-14 at 03:18, Gene Grimm wrote:
> Craig Sanders wrote:
> > \s and \t (and \d, \w, \b, and many others) are pcre (perl-compatible
> > regular expressions) which are an extension of standard regexps.
> > 
> > > If the map is a regexp style map, then you just use a tab instead of
> > > \t.
> > 
> > yep,  and use "[[:space:]]" instead of "\s"  - that matches spaces &
> > tabs, just like \s does.
> 
> For pcre style expressions how would you represent the perl pattern
> /\s{15,}[a-zA-Z0-9]{2,8}$/? Is it exactly the same in pcre as it is in
> perl? How would you represent this in regexp style (for immediate spam
> rejection patterns)?

Well, as pcre stands for 'perl compatible re', I would guess it should
be exactly the same.
But the best answer you can get is testing itself by using postmap -q
with that regex pattern and a few test-lines.

I believe a regexp style pattern is almost the same, with only \s
replaced by [[:space:]]

See the pcre(7) and regex(7) manpages for the details.

-- 
Tot ziens,

Bart-Jan


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Postfix Regular Expressions

2002-04-13 Thread Gene Grimm

Craig Sanders wrote:
> 
> correct.
> 
> \s and \t (and \d, \w, \b, and many others) are pcre (perl-compatible
> regular expressions) which are an extension of standard regexps.
> 
> > If the map is a regexp style map, then you just use a tab instead of
> > \t.
> 
> yep,  and use "[[:space:]]" instead of "\s"  - that matches spaces &
> tabs, just like \s does.

For pcre style expressions how would you represent the perl pattern
/\s{15,}[a-zA-Z0-9]{2,8}$/? Is it exactly the same in pcre as it is in
perl? How would you represent this in regexp style (for immediate spam
rejection patterns)?


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Postfix Regular Expressions

2002-04-12 Thread Craig Sanders

On Fri, Apr 12, 2002 at 06:37:15PM +0200, Bart-Jan Vrielink wrote:
> On Fri, 2002-04-12 at 16:42, Gene Grimm wrote:
> > I have simple question that I can't find documented. I need to add basic 
> > spam/virus filters to body_checks using regular expressions where the 
> > line begins with a tab character. Using "\t" or "\s" doesn't seem to 
> > work. Can anyone suggest the best way to handle this?
> 
> Are you using regexp or pcre maps ??
> If you are using pcre style regular expressions then \t should work. 

correct.

\s and \t (and \d, \w, \b, and many others) are pcre (perl-compatible
regular expressions) which are an extension of standard regexps.

> If the map is a regexp style map, then you just use a tab instead of
> \t.

yep,  and use "[[:space:]]" instead of "\s"  - that matches spaces &
tabs, just like \s does.

craig

-- 
craig sanders <[EMAIL PROTECTED]>

Fabricati Diem, PVNC.
 -- motto of the Ankh-Morpork City Watch


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Postfix Regular Expressions

2002-04-12 Thread Bart-Jan Vrielink

On Fri, 2002-04-12 at 16:42, Gene Grimm wrote:
> I have simple question that I can't find documented. I need to add basic 
> spam/virus filters to body_checks using regular expressions where the 
> line begins with a tab character. Using "\t" or "\s" doesn't seem to 
> work. Can anyone suggest the best way to handle this?

Are you using regexp or pcre maps ??
If you are using pcre style regular expressions then \t should work. If
the map is a regexp style map, then you just use a tab instead of \t.

Testing your regular expressions with postmap -q is a great way to find
out any problems with the regexes.

-- 
Tot ziens,

Bart-Jan


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Postfix Regular Expressions

2002-04-12 Thread Gene Grimm

I have simple question that I can't find documented. I need to add basic 
spam/virus filters to body_checks using regular expressions where the 
line begins with a tab character. Using "\t" or "\s" doesn't seem to 
work. Can anyone suggest the best way to handle this?



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]