[rules-users] string replace collision problem

FrankVhh frank.vanhoenshoven at agserv.eu
Wed Nov 23 11:34:35 EST 2011


Hi,

Sorry, but I fogot about you :-(.

It does not work because both wolfgang and I did get your question wrong.

If I were you, I would try to work from the opposite direction and check
whether a String matches S but not SF. Than replace that S by VOL.

A second rule could than safely check for SF and replace that by S.

In short, reverse your salience, check that S is not SF and make sure that
you replace the right S in the RHS of your rules. You do not want to update
the WM.

Regards,
Frank


fiitkar wrote
> 
> Sorry, it does not work.
> For input SF I allways get VOLVOLFVOL.
> 
> Once again: if the input is S the output should be VOL. But if the input
> string contains SF the output should be S and not VOL.
> 
> For example: 
> SF --> S
> SSF --> VOLS
> SFSF -> SS
> etc.
> 


--
View this message in context: http://drools.46999.n3.nabble.com/string-replace-collision-problem-tp3518826p3531296.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list