<br>&nbsp;&nbsp; Yes, you may use matches. The other alternative is using an eval and a regular indexOf() call to check for the existance of the substring. Drools up to versions 4.0.x is JSE 1.4 compliant, so you can&#39;t use contains() method.&nbsp; In trunk, you may also develop your own operator and plug it into the engine... although, it is not documented yet, but if you want to try, I can guide you through. And if you want to contribute docs after that, even better. :)
<br><br>&nbsp;&nbsp; It is not possible to capture groups and reuse in the RHS. I&#39;m thinking about a way to bind variables to arbitrary values in the LHS. If we implement that, than it would be possible for you to do that, but not possible at this moment.
<br><br>&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/12/14, Waruzjan Shahbazian &lt;<a href="mailto:wshahbazian@xiam.nl">wshahbazian@xiam.nl</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I need to check in the LHS of my rule if&nbsp;&nbsp;a given String contains an<br>given substring. What is the best way to do that? I can use regular<br>expression with matches, but is that the best (fastest) solution?<br>
(STRING matches &quot;(?i).*SUBSTRING.*&quot;). And can I use regulare expressions<br>capturing groups and than use the results of the groups in the RHS? If<br>not, what is the best methode to do that?<br><br>Thanks,<br><br>
Waruzjan<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">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;JBoss Drools Core Development<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>
&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>