<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Txank you<BR>
On Thu, 2009-06-25 at 08:19 -0400, Edson Tirelli wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    &nbsp;&nbsp; I added a comment to the JIRA, but replicate it here for completeness:<BR>
    <BR>
    =====<BR>
    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:<BR>
    <BR>
    &quot;.*\s(ADDR)\s.*|(ADDR)\s.*|.*\s(ADDR)&quot;<BR>
    <BR>
    You need to write:<BR>
    <BR>
    &quot;.*\\s(ADDR)\\s.*|(ADDR)\\s.*|.*\\s(ADDR)&quot;<BR>
    <BR>
    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.<BR>
    Using the type safe API, you can do:<BR>
    <BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KnowledgeBuilderConfiguration config = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();<BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; config.setOption( ProcessStringEscapesOption.NO);<BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KnowledgeBuider kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder( conf );<BR>
    <BR>
    If you prefer to use the property or configuration file, then it is:<BR>
    <BR>
    drools.parser.processStringEscapes = false<BR>
    =======<BR>
    <BR>
    &nbsp;&nbsp;&nbsp; []s<BR>
    &nbsp;&nbsp;&nbsp; Edson<BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    2009/6/25 Corneil du Plessis &lt;<A HREF="mailto:corneil@tsctech.com">corneil@tsctech.com</A>&gt;
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        I ran into some problems where a fairly simple rule fails in 5.0.1 and worked in 4.0.7.<BR>
        <BR>
        I have created an issue on JIRA <A HREF="https://jira.jboss.org/jira/browse/JBRULES-2136">https://jira.jboss.org/jira/browse/JBRULES-2136</A> and was wondering if someone else has come across that same type of problem.<BR>
        <BR>
        The rule is:<BR>
        <BR>
<PRE>
package org.drools.rules.test
import org.drools.rules.test.SimpleStringType
rule &quot;SimpleKeywordTest&quot;
        dialect &quot;java&quot; 
when
        $_theFact : SimpleStringType( stringValue matches &quot;.*\s(ADDR)\s.*|(ADDR)\s.*|.*\s(ADDR)&quot; )
then
        $_theFact.setValid(false);
end
</PRE>
        <BR>
        Whenever the <B>stringValue</B> contains something like 'MY ADDR' the rule should fire but it doesn't in 5.0.1 <BR>
        <BR>
        <FONT COLOR="#888888">Corneil</FONT>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <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>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
    <BR>
    -- <BR>
    &nbsp;Edson Tirelli<BR>
    &nbsp;JBoss Drools Core Development<BR>
    &nbsp;JBoss by Red Hat @ <A HREF="http://www.jboss.com">www.jboss.com</A>
</BLOCKQUOTE>
</BODY>
</HTML>