[rules-users] matches operator

Wolfgang Laun wolfgang.laun at gmail.com
Sun Mar 11 14:23:45 EDT 2012


The second operand of matches is just another String expression, and
therefore it could be a string literal, a variable bound to a String field,
or a String expression.

For instance, this
  $f1: Foo( $id1: id )
  $f2: Foo( this != $f1, $id2: id matches ".*" + $id1 + ".*" )
is a test for $id2 being a substring of $id1.

Or you could do
  $f1: Foo( $id1: id )
  $f2: Foo( this != $f1, $id2: id matches ".*(" + $id1 + ")\\1.*" )
which tests - what?

-W


On 11 March 2012 17:39, shawn <youngxiao121 at hotmail.com> wrote:

> Thanks
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/matches-operator-tp3816492p3816900.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120311/a778db0e/attachment.html 


More information about the rules-users mailing list