Can you please give me example of using matches operator for startswith?

 

 

Thanks,

Ashwini

 


From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Hehl, Thomas
Sent: Monday, July 09, 2007 5= :31 PM
To: 'Rules Users List'
Subject: RE: [rules-users] ma= tches operator
<= o:p>

<= span style=3D'font-size:12.0pt'> 

Also, Java is far stricter on syntax fo= r regular expressions than anything else I've seen. You can't just test your stuff at a unix prompt or using grep to see if it works. That's just the fir= st step. I generally use the vi find command.

 


From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Mark Proctor
Sent: Monday, July 09, 2007 7= :16 AM
To: Rules Users List
Subject: Re: [rules-users] ma= tches operator
<= o:p>

<= span style=3D'font-size:12.0pt'> 

<= span style=3D'font-size:12.0pt'>Read up on regular expression, what you just wrot= e there is not valid.

Mark
Ashwini Joshi wrote:

Hi,

 

 

Has anyone used the "matches" operator?=

In our application we need to support startWith, endsWith operators for string variable. I am thinking of using matches operator. But the 'matches' operator is not working. I am trying the followi= ng code

 

rule "Hello World"

    = ;  when

    = ;        m : Message(message matches "Hello*")

    = ;  then

    = ;        System.out.println( "Hello World"); <= /o:p>

end

 

 

 

And the value set in the message is "Hello Wo= rld". But it is not going into the then clause.

 

If anyone has already used matches operator I woul= d like to know how we can use it for startswith, endsWith. How do we specify t= he regular expression? Can we use "*"=

 

 

Thanks,

Ashwini

DISCLAIMER =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail may contain privileged and confid= ential information which is the property of Persistent Systems Pvt. Ltd. It is intended only fo= r the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Pvt. Ltd. does not accept any liability for virus infecte= d mails.

 


 
 
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org<=
o:p>
https://lists.=
jboss.org/mailman/listinfo/rules-users
 

<= span style=3D'font-size:12.0pt'> 

DISCLAIMER=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= This e-mail may contain privileged and confidential information which is the= property of Persistent Systems Pvt. Ltd. It is intended only for the use of= the individual or entity to which it is addressed. If you are not the inten= ded recipient, you are not authorized to read, retain, copy, print, distribu= te or use this message. If you have received this communication in error, pl= ease notify the sender and delete all copies of this message. Persistent Sys= tems Pvt. Ltd. does not accept any liability for virus infected mails.