[rules-users] Re: escaping backslash in matches clauses (documentation bug?)

Edson Tirelli tirelli at post.com
Wed Sep 26 08:01:27 EDT 2007


    Godmar,

    Thanks for letting us know. The second example you showed bellow is
delegating regexp compilation to MVEL and seems he is behaving differently
from plain DRL compile regexps, what is clearly not desired.
    May I ask you please to open a JIRA for that so we can fix and unify the
behavior?

    Thanks,
      Edson

2007/9/25, Godmar Back <godmar at gmail.com>:
>
> PS. I was a bit too quick with my email; that is not to say that I
> don't suspect there to be a problem.
> It appears to depend on whether the left-hand side of the matches
> clause is a field or a Java expression.
>
> For instance:
>
>       f : Fact( w matches "\." )
>
> does not require escaping in accordance with the documentation, but if
> I match on a different expression:
>
>      f : Fact(w.somebeanproperty matches "\\.")
>
> escaping the "\" becomes required.
>
> - Godmar
>
> On 9/25/07, Godmar Back <godmar at gmail.com> wrote:
> > The documentation states that '\' occurring in matches clauses do not
> > need escaping. However, unescaped '\' cause this error message when
> > compiling the .drl file:
> >
> > Exception in thread "main" org.drools.rule.InvalidRulePackage: Unable
> > to determine the used declarations : [Rule name=Apply XML Descriptor,
> > agendaGroup=MAIN, salience=0, no-loop=false]
> >
> >         at org.drools.rule.Package.checkValidity(Package.java:419)
> >         at org.drools.common.AbstractRuleBase.addPackage(
> AbstractRuleBase.java:292)
> >
> > Escaping the '\' as is customary in Java makes the code work.
> >
> >  - Godmar
> >
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070926/51b40f64/attachment.html 


More information about the rules-users mailing list