[rt-users] ExtractCustomField Regexp Help Needed

Kevin Falcone falcone at bestpractical.com
Thu Nov 1 09:44:16 EDT 2007


On Nov 1, 2007, at 9:20 AM, Tim Wilson wrote:

>>>> On Wed, Oct 31, 2007 at  8:47 PM, in message
> <E9111BE9-3508-4D51-83BF-D4B32EDD3DDC at mepad.net>, Darren Ellis
> <darren at mepad.net> wrote:
>
>> I am using ExtractCustomField to try to populate some custom  
>> fields by
>> scanning for values in the body of the incoming message.  My regexp
>> needs to match a starting string and then grab everything to the end
>> of the line.  I have the regexp working with egrep in the bash shell,
>> but my custom fields aren't being populated.
>
> Darren,
>
> I believe that the ExtractCustomField code is only able to inspect  
> the email headers to look for matches. I don't think it can look in  
> the message body.

Tim

It should look in the body without a problem.  I've used it to parse  
email bodies in the past.

Darren

The newer versions of ECFV are reasonably chatty when run with debug  
logging.
What does it say about what it is trying to match against your regexp?

You may also want to test with perl instead of egrep.

perl -ne 'print $1 if /CSR Contact Name\s*([\w*|\s*])*/' CSRFile

For starters, I don't think you really want | or * inside a character  
class.

-kevin




More information about the rt-users mailing list