Yes, comma in this case is cleaner, but && should work too. What error do you see? What version of Drools are you using?
[]s Edson 2009/6/1 Greg Barton <greg_bar...@yahoo.com> > > Try a comma instead of && > > WrapperClass( sentence matches ".*Alpha.*", sentence2 matches ".*Beta*.") > > --- On Mon, 6/1/09, Armaghan Mahmud <mahmud.armag...@gmail.com> wrote: > > > From: Armaghan Mahmud <mahmud.armag...@gmail.com> > > Subject: Re: [rules-users] String comparison question > > To: "Rules Users List" <rules-users@lists.jboss.org> > > Date: Monday, June 1, 2009, 11:12 AM > > Thanks for your reply Edson. What > > if I want to test for multiple substrings in different > > strings? > > > > For example, how can I find beta in sentence2? > > > > I tried to combine WrapperClass( sentence matches > > ".*Alpha.*" && sentence2 matches > > ".*Beta*.") but I got errors. > > > > Thanks, > > Armaghan > > > > 2009/5/31 Edson Tirelli <tire...@post.com> > > > > > > If the string you are looking for is a substring of > > your sentence, you need to either use a regexp or an eval to > > call for an indexOf-like method: > > > > > > WrapperClass( sentence matches ".*Alpha.*" ) > > > > []s > > Edson > > > > > > 2009/5/31 Armaghan Mahmud <mahmud.armag...@gmail.com> > > > > > > > > > > > > Hey guys, > > > > I read in a previous post that == in Drools 4.0.7 maps > > to .equals() automatically. My situation required me to put > > a String object into the working memory and do a comparison > > on it to see if a particular word is in the passed String > > sentence. Could anybody please guide me as to how to > > approach this problem? Thanks in advance. Here's my > > original code: > > > > > > > > rule "Find Alpha in a > > sentence" > > salience100 > > wrap: WrapperClass(Sentence == "Alpha") > > then > > System.out.println("Aha found > > ya!"); > > end > > > > > > _______________________________________________ > > rules-users mailing list > > rules-users@lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/rules-users > > > > > > > > > > > > -- > > Edson Tirelli > > JBoss Drools Core Development > > JBoss, a division of Red Hat @ www.jboss.com > > > > > > _______________________________________________ > > rules-users mailing list > > rules-users@lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/rules-users > > > > > > > > > > > > -----Inline Attachment Follows----- > > > > _______________________________________________ > > rules-users mailing list > > rules-users@lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/rules-users > > > > > > > _______________________________________________ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > -- Edson Tirelli JBoss Drools Core Development JBoss, a division of Red Hat @ www.jboss.com
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users