I've been checking, <br><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/regex/Pattern.html">http://download.oracle.com/javase/1.5.0/docs/api/java/util/regex/Pattern.html</a><br>and the non-capturing groups are documented in there.<br>
<br>What is Hudson using for compiling?<br>-W<br><br><br><br><div class="gmail_quote">On 24 December 2010 16:22, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On 24 December 2010 15:19, Geoffrey De Smet <span dir="ltr"><<a href="mailto:ge0ffrey.spam@gmail.com" target="_blank">ge0ffrey.spam@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">
Hi Laun,<br>
<br>
Can you take a look at this regression?<br>
<a href="https://issues.jboss.org/browse/JBRULES-2849" target="_blank">https://issues.jboss.org/browse/JBRULES-2849</a><br>
<br></div></blockquote></div><div><br>I shall, but...<br><br> </div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div text="#000000" bgcolor="#ffffff">
I believe the usage of "?" in the regexes is wrong (which is causing
the issue).<br>
For example: regex "(?<=\\W|^)-\\s*\\s+(.*?)\\s+is\\s+(.*?)$"<br>
<br>
The "?" means the character before me might or might not be there.<br>
so "ab?c" matches on "abc" and "ac"<br>
The "(" means start of a group.<br>
So "(?" should fail-fast</div></blockquote></div><div><br>"(?" is the start of a non-capturing group.<br><br></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div> (but it doesn't, just behave differently in
jdk5 and jdk6).<br></div></blockquote><div><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
Also ".*?" should fail-fast: either you want ".*" (none or more) or
".+" (one ore more).<br>
</div></blockquote></div><div><br>Not so: This is a non-greedy quantifier, and this has been in the code of 5.1.1. <br><font color="#888888">
<br>-W<br> </font></div><div><div></div><div class="h5"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><br> </div></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">
Op 24-12-10 11:23, Wolfgang Laun schreef:
<blockquote type="cite"><div><div></div><div>This is a summary of the currently implemented new
features for the DSL expansion. I'll have to add tests and
documentation, but before doing so, I'd like to learn whether
there are any objections (resulting in the removal) or suggestions
for improvement. Myself, I'm not sure about one or two items which
I've marked with "(?)". Also, there's a couple of items which
might gain from easy-to-implement additions, see "Votes, please".
An example showing most of the new options is given below.<br>
<ol>
<li>The right hand side of entry definitions can be empty.
(Useful for deleting "filler" phrases.)</li>
<li>Long entry lines can be split without the need of escaping
EOL:</li>
<ul>
<li>Any line beginning with # or // starts a DSL comment and
is not passed to the DSL parser.</li>
<li>Any line beginning with '[' starts a new entry.</li>
<li>All other lines are appended to the preceding line, with a
space replacing EOL.</li>
<li>Empty lines are inserted to maintain original line
numbers, and line and column numbers in error messages from
the parser are recalculated to reflect the user view of the
DSL text.</li>
</ul>
<li>The special comment introduction "#/" is used to mark a line
containing debug options. Currently recognized keywords are:</li>
<ul>
<li>result - dumps the resulting DRL</li>
<li>steps - shows all expansion operations in conditions and
consequences</li>
<li>keyword, when, then - display the corresponding entry
definitions</li>
<li>usage - shows how often an entry was actually used in an
expansion</li>
</ul>
<li>Variable substitution uses the definition of that variable
seen last in the current when or then part expansion. not just
from the current line. (But this probably should keep
variables from the when part for the following then part.
Votes, please.)<br>
</li>
<li>The value used in a variable substitution can be modified on
the fly by adding one of the modifiers after and '!' in the
variable reference. Currently recognized modifiers are:</li>
<ul>
<li>uc, lc - convert all letters to upper case or lower case,
respectively</li>
<li>ucfirst - convert the first letter to upper case, and all
other letters to lower case</li>
<li>num - extract all digits and a '-' preceding the first
digit and insert the numeric value; a '.' or ',' two digits
from the right is retained as a decimal point, which is
useful for monetary quantitites. (?)</li>
</ul>
<li>Another modification of the value used for substituting the
reference is by providing a "multiple choice" after an '!',
consisting of strings separated alternatively by '?' and '/':
If the string extracted from the DSLR line matches the string
before a '?', the string following it is used for
substitution; otherwise test the next choice. (?)</li>
<li>A DSL value starting with a hyphen ('-') can also be used in
a consequence to add another setter expression into a
preceding "modify(x){}". (Should probably be extended to be
able to handle the insertion of another parameter to any
preceding method call and, as a special, but useful, case the
concatenation to a preceding x.println() or x.print() call.
Votes, please.)</li>
</ol>
DSL:<br>
[when][][Tt]here is an?=<br>
[when][]{entity} called {x}=<br>
${entity!lc}: {entity!ucfirst}( $name:
name=="{x!M?Mark/E?Edson/G?Geoffrey/unknown}")<br>
[when][]and no other with the same {attr}=not {entity!ucfirst}(
{attr} == ${attr} )<br>
[then][]change person=modify($person)\{\}<br>
[then][]- set {attr} to {value} = set{attr!ucfirst}( {value!num} )<br>
<br>
DSLR:<br>
rule "Rule 1"<br>
when<br>
There is a PERSON called M<br>
and no other with the same name<br>
then<br>
change person<br>
- set salary to US$9,999.99<br>
- set rank to "colonel"<br>
end<br>
<br>
DRL:<br>
8 rule "Rule 1"<br>
9 when<br>
10 $person: Person( $name: name=="Mark")<br>
11 not Person( name == $name )<br>
12 then<br>
13 modify($person){ setSalary( 9999.99 ), setRank( "colonel" )
}<br>
14 end<br>
<br>
Cheers<br>
Wolfgang<br>
<br>
<br>
</div></div><pre><fieldset></fieldset>
_______________________________________________
rules-dev mailing list
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
With kind regards,
Geoffrey De Smet</pre>
</div>
<br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div></div></div><br>
</blockquote></div><br>