<br>rule &quot;at least one element from the array starts with abc&quot;<br>when<br>    ABC( $array : array )<br>    exists( String( this matches &quot;abc.*&quot; ) from $array )<br>then<br>    // do something<br>end<br><br>
<br><div class="gmail_quote">2008/6/25 ygaurav <span dir="ltr">&lt;<a href="mailto:ygaurav@yahoo.com">ygaurav@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>
Hi All<br>
<br>
i am new to drools and I am hoping that some body can help me out here.<br>
<br>
I data in string array and I would like to check if one of the entry starts<br>
with the string I have. How can check it  ?<br>
<br>
<br>
Code is shown below<br>
<br>
@java<br>
class ABC {<br>
String[] array = new String[]{&quot;abcdef&quot;,&quot;ghijkl&quot;,&quot;mnopqrst&quot;}<br>
<br>
}<br>
<br>
@drools<br>
rule &quot;check something&quot;<br>
when<br>
     $abc : ( ABC.array contains a single entry which start with &quot;abc&quot; )<br>
<br>
<br>
<br>
Is there a way I can do it ? If it is not possible what is way I can achive<br>
it<br>
<br>
Thanks<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://www.nabble.com/using-matches-in-a-collection-tp18115893p18115893.html" target="_blank">http://www.nabble.com/using-matches-in-a-collection-tp18115893p18115893.html</a><br>
Sent from the drools - user mailing list archive at Nabble.com.<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>
</font></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>