![]() |
Regex Pattern match, but doesn't work in productio |
Post Reply
|
| Author | |
eruberts
New User
Joined: 02 May 2012 Posts: 2 |
Post Options
Quote Reply
Topic: Regex Pattern match, but doesn't work in productioPosted: 02 May 2012 at 8:14pm |
|
I have a trigger that uses a regex pattern of “[a-z]*$” which is supposed to match any number of lowercase letters at the end of the line. For example, in emails that are parsed, I need to match the last few letters in the last line of an email such as “Groupname: prod-vm.cluster.sjc”. in the aforementioned example, “sjc” is a match, but in production, it fails to match anything.
If I use the “Run with” option within Email2DB and paste the contents of the email it will work as expected. If I use the smtptest.exe program in the program files directory of email2db, it fails to match the data as well as any production emails. I can reproduce the problem by creating a new trigger with a basic single line as the body of an email and apply the same regex. At the moment, it appears that if I create any regex that uses the “$” to anchor a pattern to the end of the regex will appear to work when creating or editing trigger, but fails to parse any information once in production. |
|
![]() |
|
eruberts
New User
Joined: 02 May 2012 Posts: 2 |
Post Options
Quote Reply
Posted: 16 May 2012 at 3:52pm |
|
Problem Solved.
Liam provided me with information which pointed out the multiple CRLF's at the end of the email message were causing the regex to not match correctly. To compensate for this I changed the regex to [a-z]*[\r\n]*$ which correctly targets the string of letters and takes into consideration one or more CRLFs at the end of the email. Thanks Liam!!!
|
|
![]() |
|
Post Reply
|
| 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 |