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