[rt-users] ExtractCustomField Regexp Help Needed
Dirk Pape
pape-rt at inf.fu-berlin.de
Thu Nov 1 10:09:35 EDT 2007
Hello Darren,
for historic reason ECFV uses "|" as delimiter in the template. If you use
"|" in your regexp what you do the template will not behave as you might
expect.
You can redefine the separator ECFV uses by inserting a line at the
beginning of your scanner template, e.g.
Separator=<#>
then you write
Customer Name<#>body<#>CSR Contact Name\s*([\w*|\s*])*<#><#>
though I think you mean
Customer Name<#>body<#>CSR Contact Name\s*([\w\s]*)<#><#>
which will match "Test Customer" into your custom field.
You will need ECVF Version 1.1b2 or later to change the separator. Actual
version is 1.2b3
<http://page.mi.fu-berlin.de/pape/rt3/ExtractCustomFieldValues.tgz>
Regards,
Dirk.
--Am 31. Oktober 2007 21:47:33 -0400 schrieb Darren Ellis
<darren at mepad.net>:
> Hello,
>
> 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.
>
> Here's the output of the egrep command:
> [dge at squidward ~]$ egrep 'CSR Contact Name\s*([\w*|\s*])*' CSRFile
> CSR Contact Name Test Customer
> [dge at squidward ~]$
>
> Here's the contents of CSRFile:
> [dge at squidward ~]$ cat CSRFile
> CSR Contact Name Test Customer
> [dge at squidward ~]$
>
> Here's the relevant line of my CFExtract Template (#18):
> Customer Name|body|CSR Contact Name\s*([\w*|\s*])*||
>
> Here's the contents of my Scrip (#16)
> Description: CFExtract
> Condition: On Create
> Action: Extract Custom Field Values
> Template: CFExtract
> Stage: TransactionCreate
>
> I do have one working that simply grabs a number from the subject line,
> so I believe that the ExtractCustomField add-on is working properly.
> Could some kind regexp/rt expert point me in the right direction?
>
> Thank you.
>
> Darren
>
> Darren Ellis
> darren at mepad.net
> Office: (207) 376-0137, x2201
> Mobile: (207) 841-4000
More information about the rt-users
mailing list