Anyone program in Perl?

Jeff Horton

Member
Messages
4,272
Location
The Heart of Dixie
If your familiar with Perl I have what will be a simple question for you. I have set up a Spam program and I need to add an exception of the list and it has to be written as a Perl expression and I can't figure it out. So I need a little help

My command is 'subject HCC' BUT, I want to add a wild card after HCC so that that anything that follows HCC is accepted. I have been reading the Perl for Dummies ;) but I can't figure this one out.
 
Last edited:
Is it a Perl regular expression you are looking for? If so:

Code:
/subject HCC.*/

will match anything that begins with the string:

subject HCC

The dot matches any character and the asterisk says match any number of characters. Dot-asterisk together says "match any number of any characters".
 
That should help. It's sever software called Boxtrapper, you may be familiar with it. Just trying to add a couple of mailing lists using the subject so I don't have to whitelist every members email address. That would be never ending!!

Here is their examples they give:

subject i love you
from nick\@nicedomain\.org
from .+\@domain\.com
cc mailinglist\@domain\.com
to alias\@domain\.com

Base on that and what you said I am assuming my command should be

subject hcc.*/
 
I think Mat has steered you straight on this.

Here's a little regex tester.

http://www.spaweditor.com/scripts/regex/index.php

I entered
/HCC.+/
as the regular expression and
HCC This is a test
as the test data.

I'm assuming that you will be putting that into your 'blacklist' and It shows that it will trap anything starting with HCC

I'm actually going to book mark this page, as it looks like a nice little way to test these sorts of things....
 
Top