Need help for RegExp

Moderator: crythias

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

Need help for RegExp

Postby kongyong92 » 04 Apr 2018, 03:42

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
Best regards,
Kong-Yong

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

Re: Need help for RegExp

Postby kongyong92 » 18 Apr 2018, 03:52

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


Return to “General”

Who is online

Users browsing this forum: Bing [Bot], skilled and 3 guests