[rules-users] DSL regex support

Edson Tirelli tirelli at post.com
Tue Oct 23 17:10:16 EDT 2007


   Adam, just use the metadata brackets leaving them blank. This should
work:

[when][][Ff]act value is "{value}"= SomeFact( value == "{value}")

   The first 2 pairs of [] have special semantics for the engine. After
them, you can place your regexps.

   []s
   Edson

2007/10/23, Adam Lewandowski <adam at alewando.com>:
>
> I just upgraded to 4.0.3 and want to take advantage of regex support for
> my DSL. Specifically, I want to be able to use a character class at the
> start of my expander expression to allow the first character to be case
> insensitive. For example (in the expander definition):
>
> [when][Ff]act value is "{value}"= SomeFact( value == "{value}")
>
> So that the rule could be written as "Fact value is..." or "fact value
> is....". But I think this conflicts with a syntax that the parser uses
> to add constraints to the previous declaration (according to the
> reference docs, section 6.7.4). If I try to use the same character class
> construct anywhere other than the first character it works fine.
> Is there some escape sequence I can use to get what I'm looking for?
> Simply escaping the [ and ] with \ didn't work.
>
> Thanks,
> Adam Lewandowski
> _______________________________________________
> 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/20071023/101d9843/attachment.html 


More information about the rules-users mailing list