<br>&nbsp;&nbsp; Hmm, this seems like a bug... may I ask you please to open a JIRA and attach your test case?<br><br>&nbsp;&nbsp; Thank you,<br>&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/7/12, hare ram &lt;<a href="mailto:hare.bond@gmail.com">
hare.bond@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello everyone,<br><br>The rules I wrote are <br><br><br>
rule &quot;Test 1 Rule&quot;<br>&nbsp;&nbsp; &nbsp;salience 1000<br>&nbsp;&nbsp; &nbsp;when<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">&nbsp;Line ( $admin : line)</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $admin.matches(&quot;^.*@\\S*[#&gt;]\\s*show\\s+interface[s]*\\s*$&quot;))</span><br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $lineSecond : line)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $lineSecond.matches(&quot;^\\s*(\\S+)\\s+is\\s+(up|down|administratively down),\\s*line\\s+protocol\\s+is\\s+(up|down)\\s*$&quot;))
<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device : Device()<br>&nbsp;&nbsp; &nbsp;then<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(&quot;********************************************&quot;);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device.setVendorType(&quot;Foundry&quot;);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>end<br><br>rule &quot;Juniper Show Interface CanIParse() Rule&quot;
<br>&nbsp;&nbsp; &nbsp;salience 5000<br>&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp; &nbsp;when<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $regex : line)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $regex.matches(&quot;^.*@\\S*[#&gt;]\\s*show\\s+interface[s]*\\s*$&quot;))<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $lineStr : line)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $lineStr.matches(&quot;^.*\\s*Physical\\s+interface:\\s*([^,\\s]+),\\s+([^,]+),.*$&quot;)) 
<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device : Device()<br>&nbsp;&nbsp; &nbsp;then<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(&quot;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&quot;);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device.setVendorType(&quot;Juniper&quot;);<br>end<br><br><br>
Basically the rules are searching for two regular expressions, of which one is same for the both of the 
rules.But when i write the rules like the above<br>I do not get the correct o/p, but however if i change my rules to (bold) as below, I get the correct output.So is it necessary the the declaration has<br>to be same if the both the rules have same regex
<br><br>rule &quot;Test 1 Rule&quot;<br>
&nbsp;&nbsp; &nbsp;salience 1000<br>
&nbsp;&nbsp; &nbsp;when<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<span style="font-weight: bold;">Line ( $regex : line)</span><br style="font-weight: bold;"><span style="font-weight: bold;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $regex.matches(&quot;^.*@\\S*[#&gt;]\\s*show\\s+interface[s]*\\s*$&quot;</span>))<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $lineSecond : line)<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval (
$lineSecond.matches(&quot;^\\s*(\\S+)\\s+is\\s+(up|down|administratively
down),\\s*line\\s+protocol\\s+is\\s+(up|down)\\s*$&quot;))<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device : Device()<br>
&nbsp;&nbsp; &nbsp;then<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(&quot;********************************************&quot;);<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device.setVendorType(&quot;Foundry&quot;);<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>
end<br>
<br>
rule &quot;Juniper Show Interface CanIParse() Rule&quot;<br>
&nbsp;&nbsp; &nbsp;salience 5000<br>
&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;when<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $regex : line)<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $regex.matches(&quot;^.*@\\S*[#&gt;]\\s*show\\s+interface[s]*\\s*$&quot;))<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $lineStr : line)<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $lineStr.matches(&quot;^.*\\s*Physical\\s+interface:\\s*([^,\\s]+),\\s+([^,]+),.*$&quot;)) <br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device : Device()<br>
&nbsp;&nbsp; &nbsp;then<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(&quot;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&quot;);<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device.setVendorType(&quot;Juniper&quot;);<br>
end<br><br>Thanks<br>Shiva<br>
<br>_______________________________________________<br>rules-dev mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">
https://lists.jboss.org/mailman/listinfo/rules-dev</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646
<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>