RegEx to catch attachments with multiple extensions. |
Post Reply
|
| Author | |
Lance
Guest Group
|
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Desperado
Senior Member
Joined: 27 January 2005 Location: United States Status: Offline Points: 1143 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
Wes
Guest Group
|
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
Desperado
Senior Member
Joined: 27 January 2005 Location: United States Status: Offline Points: 1143 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
Desperado
Senior Member
Joined: 27 January 2005 Location: United States Status: Offline Points: 1143 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0.284 seconds.


Topic Options
Post Options
Thanks(0)


