[SOLVED] Need help for RegExp

Moderator: crythias

Post Reply
kongyong92
Znuny newbie
Posts: 43
Joined: 15 Sep 2017, 11:40
Znuny Version: OTRS v5.0.10
Real Name: Kong-Yong
Company: Rhenus Logistics

[SOLVED] Need help for RegExp

Post by kongyong92 »

Dear all,

I have already installed the EnhancedPostMasterFilter - it worked okay for one filter rule but not for the one below.

Any RegExp experts who can help me out/spot my mistake?

Any help is very much appreciated!!

Filter condition:
POL, Country:\s+(?<pol>\d+)\s*POD, Country:\s+(?<pod>.*?)\s*Client \(Shipper or Consignee\):\s+(?<client>.*)\s*Commodity:\s+(?<commodity>.*)\s*Type of Container with Volume:\s+(?<typevol>.*)\s*Weight per Container:\s+(?<wgt>.*)\s*Competitor:\s+(?<competitor>.*)\s*Incoterm:\s+(?<incoterm>.*)\s*Cargo Readiness:\s+(?<cargoready>.*)\s*Special Requirements:\s+(?<special>.*)\s*Rate Validity:\s+(?<ratevalidity>.*)


To set the respective dynamic fields:
[**\pol**]
[**\pod**]
[**\client**]
[**\commodity**]
[**\typevol**]
[**\wgt**]
[**\competitor**]
[**\incoterm**]
[**\cargoready**]
[**\special**]
[**\ratevalidity**]

Test data:
From: test@otrs.com
To: customer@otrs.com
Subject: test named captures

POL, Country: test1
POD, Country: test2
Client (Shipper or Consignee): test3
Commodity: test4
Type of Container with Volume: test5
Weight per Container: test6
Competitor: test7
Incoterm: test8
Cargo Readiness: test9
Special Requirements: test10
Rate Validity: 04-05-92
Last edited by kongyong92 on 11 Apr 2019, 04:46, edited 1 time in total.
Best regards,
Kong-Yong
kongyong92
Znuny newbie
Posts: 43
Joined: 15 Sep 2017, 11:40
Znuny Version: OTRS v5.0.10
Real Name: Kong-Yong
Company: Rhenus Logistics

Re: Need help for RegExp

Post by kongyong92 »

Dear all,

I have managed to find my error. just in case anyone needs something similar, below is the Filter Condition:
POL, Country:\\s+(?<pol>.*?)\\s*POD, Country:\\s+(?<pod>.*?)\\s*Client \\(Shipper or Consignee\\):\\s+(?<client>.*)\\s*Commodity:\\s+(?<commodity>.*)\\s*Type of Container with Volume:\\s+(?<typevol>.*)\\s*Weight per Container:\\s+(?<wgt>.*)\\s*Competitor:\\s+(?<competitor>.*)\\s*Incoterm:\\s+(?<incoterm>.*)\\s*Cargo Readiness:\\s+(?<cargoready>.*)\\s*Special Requirements:\\s+(?<special>.*)\\s*Rate Validity:\\s+(?<ratevalidity>.*)

Note: i added two forward slashes to update it manually via the database due to the 100 characters limitation in the UI.

Cheers! :)
Best regards,
Kong-Yong
Post Reply