Spam Filter ISP Support Forum

  New Posts New Posts RSS Feed - RegEx to catch attachments with multiple extensions.
  FAQ FAQ  Forum Search   Register Register  Login Login

RegEx to catch attachments with multiple extensions.

 Post Reply Post Reply
Author
Lance View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lance Quote  Post ReplyReply Direct Link To This Post Topic: RegEx to catch attachments with multiple extensions.
    Posted: 03 March 2004 at 3:46pm

Hello,

I am trying to create a regex that would catch attachments with multiple extensions, ie file.zip.html. I have tried (.*?[.]{1})(.*?[.]{1}) and it works in the RegEx Test tab but in production I recieve errors in the log like:

String matching error for (GCRNekit.pdf --and-- (.*?[.]{1})(.*?[.]{1})) : TRegExpr(comp): ParseReg Unmatched () (pos 10)

Any RegEx gurus have a suggestions?

Thanks

LAnce

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: 03 March 2004 at 4:05pm

Lance,

(.*?[.]{1})(.*?[.]{1})  should be inserted in the GUI as ((.*?[.]{1})(.*?[.]{1})) .  The entire expression must ALLWAYS be inside a () pair but the () pair is not required by the RegEx test in the application.  I did not test to see if the expression works however.

Dan S.

Back to Top
Wes View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wes Quote  Post ReplyReply Direct Link To This Post Posted: 04 March 2004 at 12:57pm
Won't this also catch  web address http://www.whatever.com? I am trying to learn about RegEx.  Thanks
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: 04 March 2004 at 6:32pm

Yes it will.  I was not looking at the actual expression ... just the error.  I have not even taken a look at what is needed to do what was intended.  I was just trying to make sure that it is known that any expression needs to be inside a "()" pair.

Regards,

Dan S.

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: 04 March 2004 at 6:35pm

Hey ... but if the expression above is only looking at "Attachments" then it will block multi extensions and the fact that it will block a web URL doesn't matter because we are only looking at the attachment firld.

Dan S.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.284 seconds.