You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by catshout <ge...@web.de> on 2016/09/03 09:21:57 UTC
Camel Simple regex isn't being executed but shown as string instead
Dear community,
I'm using following lines in my Camel route
<setProperty propertyName="SenderGLN">
<simple>${in.body} regex '\:.\+(.*?)\:'</simple>
</setProperty>
<log message="SenderGLN: ${exchangeProperty.SenderGLN}" />
The log entry is like the following
SenderGLN:
UNB+UNOA:3+4388800000007:14+4008336000004:14+160627:0710+00007+++++EANCOM'UNH+1+ORDERS:D:96A:UN:EAN008'BGM+220+0627018'DTM+137:20160627:102'DTM+2:20160704:102'NAD+SU+4008336000004::9'NAD+BY+4388100000004::9'NAD+DP+4388100201517::9'LIN+1++4008336070427:EN'PIA+1+17042:SA'QTY+21:75'UNS+S'CNT+1:75'UNT+13+1'UNZ+1+00007'
regex '\:.\+(.*?)\:'
Means the "regex" isn't being executed but interpreted as plain text. I've
researched a while but didn't find anything. Any ideas?
For reference .. I'm using Camel 2.16.2 inside ServiceMix 7.0.0.M1.
Best
- Gerald
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Simple-regex-isn-t-being-executed-but-shown-as-string-instead-tp5787167.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel Simple regex isn't being executed but shown as string instead
Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
Have you tried setting the resultType attribute on the simple element?
<simple resultType=“Boolean”>…</simple>
Also, should the expression match the sample data? When I set the resultType attribute, I’m getting “false” - indicating the regex didn’t match. Can you elaborate on the pattern you’re trying to match?
> On Sep 3, 2016, at 3:21 AM, catshout <ge...@web.de> wrote:
>
> ${in.body} regex '\:.\+(.*?)\:'