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

S​e​n​d​e​r​G​L​N​:​
​U​N​B​+​U​N​O​A​:​3​+​4​3​8​8​8​0​0​0​0​0​0​0​7​:​1​4​+​4​0​0​8​3​3​6​0​0​0​0​0​4​:​1​4​+​1​6​0​6​2​7​:​0​7​1​0​+​0​0​0​0​7​+​+​+​+​+​E​A​N​C​O​M​'​U​N​H​+​1​+​O​R​D​E​R​S​:​D​:​9​6​A​:​U​N​:​E​A​N​0​0​8​'​B​G​M​+​2​2​0​+​0​6​2​7​0​1​8​'​D​T​M​+​1​3​7​:​2​0​1​6​0​6​2​7​:​1​0​2​'​D​T​M​+​2​:​2​0​1​6​0​7​0​4​:​1​0​2​'​N​A​D​+​S​U​+​4​0​0​8​3​3​6​0​0​0​0​0​4​:​:​9​'​N​A​D​+​B​Y​+​4​3​8​8​1​0​0​0​0​0​0​0​4​:​:​9​'​N​A​D​+​D​P​+​4​3​8​8​1​0​0​2​0​1​5​1​7​:​:​9​'​L​I​N​+​1​+​+​4​0​0​8​3​3​6​0​7​0​4​2​7​:​E​N​'​P​I​A​+​1​+​1​7​0​4​2​:​S​A​'​Q​T​Y​+​2​1​:​7​5​'​U​N​S​+​S​'​C​N​T​+​1​:​7​5​'​U​N​T​+​1​3​+​1​'​U​N​Z​+​1​+​0​0​0​0​7​'​
​r​e​g​e​x​ ​'​\​:​.​\​+​(​.​*​?​)​\​:​'

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 '\:.\+(.*?)\:'