[TriLUG] Regular Expression Help

Nathan Conrad conrad at bungled.net
Wed Dec 24 14:06:55 EST 2003


By default, postfix's prce (perl-compatible regular expressions) are
case-insensitive. In order to make them case sensitive, add an i flag
to the end:

/^Subject: Re: [A-Z]{2,8}, [a-zA-Z]+ [a-zA-Z]+ [a-zA-Z]+$/i     REJECT

Be careful about matching the various ways that subject can be
capitalized; subject is different from Subject with the i flag turned
on.

-Nathan

On Wed, Dec 24, 2003 at 01:26:26PM -0500, Tarus Balog wrote:
> 
> On Dec 24, 2003, at 11:55 AM, Nathan Conrad wrote:
> 
> >Hi,
> >
> >Here is a POSIX-compatible regular expression:
> >
> >^Re: [A-Z]{2,8}, [^ ]* [^ ]* [^ ]*$
> 
> Thanks for everyone's help, but it is still stumping me. This is what I  
> have in my postfix header_checks:
> 
> /^Subject: Re: [A-Z]{2,8}, [a-zA-Z]+ [a-zA-Z]+ [a-zA-Z]+$/     REJECT
> 
> Unfortunately, while is catches the SPAM, it also catches:
> 
> Re: Really, this should work
> 
> etc. Basically, it seems to be matching any word, 2-8 characters long,  
> versus just words made up of capital letters. Something like:
> 
> Re: s, this is small
> 
> does not match.
> 
> -T
> 
> ________________________________________________________________________ 
> ___
> Tarus Balog							Main:	 +1 
> 919 545 2553
> Blast Internet Services, Inc.			Fax:			+1 
> 919 542 5955
> Email: tarus at blast.com					URL: 
> http://www2.blast.com/tarus
> PGP Key Fingerprint: 8945 8521 9771 FEC9 5481  512B FECA 11D2 FD82 B45C
> 
> -- 
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc

-- 
Nathan J. Conrad                     Campus phone #5930
301 Scott hall, UNC Charlotte        http://bungled.net
GPG: F4FC 7E25 9308 ECE1 735C  0798 CE86 DA45 9170 3112
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://www.trilug.org/pipermail/trilug/attachments/20031224/26015d56/attachment.pgp>


More information about the TriLUG mailing list