camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" ...@silverbullet.dk>
Subject RE: Regular Expressions
Date Thu, 02 Oct 2008 16:53:35 GMT
Hi

You are Welcome. Its already there but its named: regex

    /**
     * Creates a predicate which is true if this expression matches the given
     * regular expression
     * 
     * @param regex the regular expression to match
     * @return a predicate which evaluates to true if the expression matches the
     *         regex
     */
    public Predicate<E> regex(String regex) {



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: dkozic [mailto:drazen.kozic@asw.eu] 
Sent: 2. oktober 2008 18:48
To: camel-user@activemq.apache.org
Subject: RE: Regular Expressions


This is what I am looking for. Thanks a lot!


Claus Ibsen wrote:
> 
> Hi
> 
> But it could be a good idea with a regexp(pattern) predicate add to a
> builder, so you can do it with the fluent builders?
> 
> I actually thought there was one already.
> 
> eg to filter all kind of test users in a route:
> from("activemq:orders").
> filter().header("username").regexp("$.*test^").to("seda:queue:justTests")
> .to("bean:processOrder");
> 
> 
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> -----Original Message-----
> From: dkozic [mailto:drazen.kozic@asw.eu] 
> Sent: 2. oktober 2008 16:03
> To: camel-user@activemq.apache.org
> Subject: Re: Regular Expressions
> 
> 
> Thanks James
> 
> Bean language is just OK. I will create custom bean for regex pattern
> matching.
> 
> 
> James.Strachan wrote:
>> 
>> 2008/10/2 dkozic <drazen.kozic@asw.eu>:
>>>
>>> I need to inspect value of the body or value of the header against
>>> regular
>>> expression.
>>> It will be good if routing could be made after regexp matching.
>> 
>> For now the easiest way to do this is just invoke a Java method as an
>> expression within the routing logic.
>> http://activemq.apache.org/camel/bean-language.html
>> 
>>> Can you tell me more about helper methods you mentioned?
>> 
>> They are just helper methods for creating a regex expression for use in
>> the DSL
>> 
>> 
>> 
>> -- 
>> James
>> -------
>> http://macstrac.blogspot.com/
>> 
>> Open Source Integration
>> http://open.iona.com
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Regular-Expressions-tp19778962s22882p19779910.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Regular-Expressions-tp19778962s22882p19783151.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message