On Wed, Jul 1, 2009 at 8:30 PM, Rodrigo Valerio<[email protected]> wrote:
>
> The regex in the code above is never true in 2.0-M2
> from("direct:a").setBody(constant("000000000001111111"))
> .choice()
> .when( body(String.class).regex("^.*") ).process( new MyProcessor() )
> .otherwise().end
>
> In 2.0-M1 is ok.
> In java Pattern/Matcher it runs ok too.
> This regex is to verify if the line starts with "0".
You regex is wrong
It should be "^0.*$"
This works for me
from("direct:a")
.choice()
.when(body(String.class).regex("^0.*$")).to("mock:result")
.otherwise().to("mock:other")
.end();
>
> Anyone know a workaround for this?
> I need a body(String.class).startsWith("0") or similar... In file processor
> this is very usefull...
> --
> View this message in context:
> http://www.nabble.com/camel-2.0-M2-regex-bug-tp24294888p24294888.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
--
Claus Ibsen
Apache Camel Committer
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus