The Four Word Film Review Fourum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Return to my fwfr
Frequently Asked Questions Click for advanced search
 All Forums
 Off-Topic
 General
 Does anyone speak Perl? Please!
 New Topic  Reply to Topic
 Send Topic to a Friend
 Printer Friendly
Author Previous Topic Topic Next Topic  

BaftaBaby 
"Always entranced by cinema."

Posted - 10/29/2010 :  12:17:13  Show Profile  Reply with Quote
Hi

I'm updating my mail server spam filter to BoxTrapper, which seems much more user-friendly than Spam Assassin.

It asks for white/black lists to be in standard Perl formula and gives this example:
quote:
The list should contain one entry per line. Entries should be in the format of a perl regular expression.
For example: [email protected] would be john\@domain\.com and all addresses at domain.com would be .+\@domain\.com




My question is, suppose either the eMail preface (before the @ sign), and/or the domain id (.com, .net, etc) ALSO contain a dot. Would I then preface all the dots with a backslash?

So, if the example they give above were changed to
[email protected]
would my listing be formatted as
john\.doe\@domain\.co\.uk

Your words of wisdom are worth more than Perls to me
Bigtime TIA!

benj clews 
"...."

Posted - 10/29/2010 :  12:29:32  Show Profile  Reply with Quote
Not to be picky but this isn't the programming language Perl. It's regular expression notation- a commonly-used pattern matching technique used in most programming languages, text editors, operating systems and so on

I have to admit I'm not sure of the differences between Perl's interpretation of regular expressions and standard regular expressions but from this example the two look identical.

The \ is called an escape character and as such says "whatever character follows me should be treated as what it literally is", rather than any special reserved function it may have in a regular expression. For example . by itself would effectively be saying "this can be any letter, number or symbol" (so 'b.n' would match 'ben' or 'bin') but by putting the \ in front of it you are looking to match the . character only (so 'b\.n' would match 'b.n' and nothing else)

In short, yes- you need to put the \ in front of the . (or indeed any full-stops anywhere in the email address) so your spam filter knows to treat it as only a full-stop.
Go to Top of Page

BaftaBaby 
"Always entranced by cinema."

Posted - 10/29/2010 :  12:45:14  Show Profile  Reply with Quote
quote:
Originally posted by benj clews

Not to be picky but this isn't the programming language Perl. It's regular expression notation- a commonly-used pattern matching technique used in most programming languages, text editors, operating systems and so on

I have to admit I'm not sure of the differences between Perl's interpretation of regular expressions and standard regular expressions but from this example the two look identical.

The \ is called an escape character and as such says "whatever character follows me should be treated as what it literally is", rather than any special reserved function it may have in a regular expression. For example . by itself would effectively be saying "this can be any letter, number or symbol" (so 'b.n' would match 'ben' or 'bin') but by putting the \ in front of it you are looking to match the . character only (so 'b\.n' would match 'b.n' and nothing else)

In short, yes- you need to put the \ in front of the . (or indeed any full-stops anywhere in the email address) so your spam filter knows to treat it as only a full-stop.



You see -- THIS is why you are benj, the genius -- to give you your full title!

Thanks so much, benj, and here's to my spam-free world

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Send Topic to a Friend
 Printer Friendly
Jump To:
The Four Word Film Review Fourum © 1999-2024 benj clews Go To Top Of Page
Snitz Forums 2000