Parker Software Ltd Homepage
Forum Home Forum Home > Email2DB Email Parser > Email2DB Version 3
  New Posts New Posts RSS Feed: Regex Pattern match, but doesn't work in productio
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Regex Pattern match, but doesn't work in productio

 Post Reply Post Reply
Author
Message
eruberts View Drop Down
New User
New User


Joined: 02 May 2012
Posts: 2
Post Options Post Options   Quote eruberts Quote  Post ReplyReply Direct Link To This Post Topic: Regex Pattern match, but doesn't work in productio
    Posted: 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 create or edit the trigger and paste the contents in the box, the regex pattern will show as a match.

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.

 
Any ideas as to what I may be doing wrong?

Back to Top
eruberts View Drop Down
New User
New User


Joined: 02 May 2012
Posts: 2
Post Options Post Options   Quote eruberts Quote  Post ReplyReply Direct Link To This Post 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!!!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.094 seconds.
These are the forums for Parker Software, developers of Live Chat Software: WhosOn and Email Automation Software: Email2DB.