[jboss-jira] [JBoss JIRA] Closed: (JBRULES-2136) Simple match rule fails on 5.0.1 and works on 4.0.7
Edson Tirelli (JIRA)
jira-events at lists.jboss.org
Thu Jun 25 08:17:56 EDT 2009
[ https://jira.jboss.org/jira/browse/JBRULES-2136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Edson Tirelli closed JBRULES-2136.
----------------------------------
Resolution: Rejected
Due to some limitations on the way that Drools 4 handles regexps, we had to change the default escaping syntax for regexps, from single escape to double escape. In Drools 5, regexps work exactly like in Java. So, instead of doing:
".*\s(ADDR)\s.*|(ADDR)\s.*|.*\s(ADDR)"
You need to write:
".*\\s(ADDR)\\s.*|(ADDR)\\s.*|.*\\s(ADDR)"
If you would like to continue using regexps in the same way you did for Drools 4, i.e., with single escape (not recommended), there is a configuration that makes Drools 5 parse regexps as it did in Drools 4.
Using the type safe API, you can do:
KnowledgeBuilderConfiguration config = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
config.setOption( ProcessStringEscapesOption.NO);
KnowledgeBuider kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder( conf );
If you prefer to use the property or configuration file, then it is:
drools.parser.processStringEscapes = false
> Simple match rule fails on 5.0.1 and works on 4.0.7
> ---------------------------------------------------
>
> Key: JBRULES-2136
> URL: https://jira.jboss.org/jira/browse/JBRULES-2136
> Project: JBoss Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-core
> Affects Versions: 5.0.1.FINAL
> Reporter: Corneil du Plessis
> Assignee: Edson Tirelli
> Priority: Critical
> Attachments: drools-test.zip
>
>
> A simple rule that worked in 4.0.7 fails in 5.0.1
> An Eclipse project to illustrate the problem will be attached to this issue
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list