<br> Markus,<br><br> Yes, eval code block will pass through DRL compiler into the java compiler. So you need to write the regexp as it is written in standard java code.<br> Now, this must work:<br><br>Item( title matches "^Test\s*" )
<br><br> Does not matter what characters title contains. If it is not working, it is a bug. Can you please submit a JIRA with a test case showing the problem?<br><br> Thanks,<br> Edson<br><br><div><span class="gmail_quote">
2007/10/10, Markus Helbig <<a href="mailto:mhelbig81@googlemail.com">mhelbig81@googlemail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
rule "PatternTest"<br> when<br> $pli:Item( eval(title.matches("^Test\s*")) )<br> then<br> #<br>end<br><br>Having a second look i realize that the DroolsParser should not parse
<br>the pattern string because it's java code ... and i can't use title<br>matches "^Test\s*" because title may have chars like (,\ and so on<br>that resolves into a RuntimeException (sth. with Groups not closed in
<br>RegEx).<br><br>Cheers<br><br>Markus<br><br>2007/10/10, Edson Tirelli <<a href="mailto:tirelli@post.com">tirelli@post.com</a>>:<br>><br>> Markus,<br>><br>> Can you please show me your rule?<br>>
<br>> []s<br>> Edson<br>><br>> 2007/10/10, Markus Helbig <<a href="mailto:mhelbig81@googlemail.com">mhelbig81@googlemail.com</a> >:<br>> > Hi,<br>> ><br>> > no same exception when i use "\\s". JDK didn't change when i switched
<br>> > from 3.x to 4.x<br>> ><br>> > Cheers<br>> ><br>> > Markus<br>> ><br>> > 2007/10/10, DELBART Vincent <<a href="mailto:delbart.v@mipih.fr">delbart.v@mipih.fr</a>>:<br>
> > > Hi,<br>> > ><br>> > > I think you have to use "Test\\s+".<br>> > ><br>> > > I don't think it's a DROOLS problem (maybe jdk).<br>> > ><br>> > > V.
<br>> > ><br>> > ><br>> > > -----Message d'origine-----<br>> > > De : <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">
rules-users-bounces@lists.jboss.org</a>] De la part de<br>> Markus Helbig<br>> > > Envoyé : mercredi 10 octobre 2007 11:12<br>> > > À : <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org
</a><br>> > > Objet : [rules-users] pattern<br>> > ><br>> > > Drools Documentation says:<br>> > ><br>> > > Matches a field against any valid Java Regular Expression. Typically<br>
> that regexp is a String, but variables that resolve to a valid regexp are<br>> also allowed. It is important to note that different from java, if you write<br>> a String regexp directly on the source file, you don't need to escape '\'.
<br>> Example:<br>> > ><br>> > > but<br>> > ><br>> > > "Test\s+" is a valid RegEx (it was valid in Drools 3.x too), but now:<br>> > ><br>> > > SyntaxfehlerRule Compilation error : [Rule name=OnlineStreaming Start,
<br>> agendaGroup=MAIN, salience=100, no-loop=true]<br>> com/p7s1/swi/phoenix/n24/Rule_OnlineStreaming_Start_0.java<br>> (19:923) :<br>> > > Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
<br>> > ><br>> > ><br>> > ><br>> > > What i'm doing wrong here?<br>> > ><br>> > > Cheers<br>> > ><br>> > > Markus<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>> > > _______________________________________________<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>> ><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>><br>><br>><br>> --<br>> Edson Tirelli<br>> Software Engineer - JBoss Rules Core Developer<br>> Office: +55 11 3529-6000<br>> Mobile: +55 11 9287-5646<br>> JBoss, a division of Red Hat @
<a href="http://www.jboss.com">www.jboss.com</a><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>><br><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></blockquote></div>
<br><br clear="all"><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">
www.jboss.com</a>