Spam Filter ISP Support Forum

  New Posts New Posts RSS Feed - Regular Expression Help
  FAQ FAQ  Forum Search   Register Register  Login Login

Regular Expression Help

 Post Reply Post Reply
Author
Dan B View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 February 2005
Location: United States
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan B Quote  Post ReplyReply Direct Link To This Post Topic: Regular Expression Help
    Posted: 11 January 2006 at 2:48pm

I'm trying to get a RexEx for a following example to email address. I've been using the RegEx Test and having no luck.

Let say I would like to block an address that is thisname@mydomain.com only and not block any other combination with any_number_of_letters_thisname@mydomain.com including the underscores

I have the following:

((?i)([^\w]+)thisname\@mydomain\.com)

It's not working correctly.  It's doing the opposite.  It's catching any_number_of_letters_thisname@mydomain.com but not just thisname@mydomain.com

If anybody could help that would be great.
Thanks,
Dan B

Back to Top
Desperado View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 January 2005
Location: United States
Status: Offline
Points: 1143
Post Options Post Options   Thanks (0) Thanks(0)   Quote Desperado Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2006 at 10:57am

Dan,

Perhaps I am not understanding the question but ...

((?i)^thisname\@mydomain\.com)

The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com

Back to Top
Dan B View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 February 2005
Location: United States
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan B Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2006 at 11:32am

Dan S,

This is what I want to happen example.

block
thisname@mydomain.com

do not block anthing else.
abc_thisname@mydomain.com
def_thisname@mydomain.com
123_thisname@mydomain.com
xyz_thisname@mydomain.com
abcthisname@mydomain.com

I hope this helps.

Thanks,
Dan B

Back to Top
Desperado View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 January 2005
Location: United States
Status: Offline
Points: 1143
Post Options Post Options   Thanks (0) Thanks(0)   Quote Desperado Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2006 at 12:43pm

Dan,

The RegEx I posted *should* do that.  At least, it does in my tests.

The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com

Back to Top
Dan B View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 February 2005
Location: United States
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan B Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2006 at 3:34pm

Dan,

Something is very strange.  I copied and pasted your example and tried it and it didn't work.  I went to lunch and tried it again when I came back and it now works in the test with out changing anything.

Thanks,
Dan B

Back to Top
Dan B View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 February 2005
Location: United States
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan B Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2006 at 3:46pm

Dan,

I'm having a brain fart today. Can you explain the reason of using the (?i) in front of any RegEx

Thanks,
Dan B

 

 

Back to Top
Desperado View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 January 2005
Location: United States
Status: Offline
Points: 1143
Post Options Post Options   Thanks (0) Thanks(0)   Quote Desperado Quote  Post ReplyReply Direct Link To This Post Posted: 13 January 2006 at 1:53pm

Hmmm ... my perl habit  I makes sure that there is NO case sensitivity in the character search.

Technically,  if your RegEx is written in all lower case, I suppose you wouldn't need it.



Edited by Desperado
The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.063 seconds.