<br>&nbsp;&nbsp;&nbsp; Hi, yes, close to that:<br><br>name returns [String name]<br>&nbsp;&nbsp;&nbsp; : &nbsp;&nbsp;&nbsp; ID { $name = $ID.text; }<br>&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp; STRING { $name = getString( $STRING.text ); }<br>&nbsp;&nbsp;&nbsp; ;<br><br>&nbsp;&nbsp;&nbsp; So, a rule name can be either an ID or a STRING. ID is what you got already:
<br><br>ID&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp; (&#39;a&#39;..&#39;z&#39;|&#39;A&#39;..&#39;Z&#39;|&#39;_&#39;|&#39;$&#39;|&#39;\u00c0&#39;..&#39;\u00ff&#39;)(&#39;a&#39;..&#39;z&#39;|&#39;A&#39;..&#39;Z&#39;|&#39;_&#39;|&#39;0&#39;..&#39;9&#39;|&#39;\u00c0&#39;..&#39;\u00ff&#39;)* 
<br>&nbsp;&nbsp;&nbsp; ;<br><br>&nbsp;&nbsp;&nbsp; A String is a valid Java string... so pretty much anything enclosed in either &quot; or &#39;.<br><br>STRING<br>&nbsp;&nbsp;&nbsp; :&nbsp; (&#39;&quot;&#39; ( EscapeSequence | ~(&#39;\\&#39;|&#39;&quot;&#39;) )* &#39;&quot;&#39;)
<br>&nbsp;&nbsp;&nbsp;&nbsp; | (&#39;\&#39;&#39; ( EscapeSequence | ~(&#39;\\&#39;|&#39;\&#39;&#39;) )* &#39;\&#39;&#39;)<br>&nbsp;&nbsp;&nbsp; ;<br><br>&nbsp;&nbsp;&nbsp; In other words, if you want to allow the user to write rule names and don&#39;t want to bother in validating it, just enclose the rule name in &quot; and be done with it. The only thing that may be good is to limit the length of the string... you may want to use a hard limit around 60 characters I guess.
<br><br>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br><br>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/8/2, hypnosat7 &lt;<a href="mailto:ablarbi@yahoo.fr">ablarbi@yahoo.fr</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;">
<br>No I mean how can I check the validity of the rule names before put it in a<br>DB, maybe I have to look to DRL.g grammar file ?<br>is it this :<br><br>ID<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<br>(&#39;a&#39;..&#39;z&#39;|&#39;A&#39;..&#39;Z&#39;|&#39;_&#39;|&#39;$&#39;|&#39;\u00c0&#39;..&#39;\u00ff&#39;)(&#39;a&#39;..&#39;z&#39;|&#39;A&#39;..&#39;Z&#39;|&#39;_&#39;|&#39;0&#39;..&#39;9&#39;|&#39;\u00c0&#39;..&#39;\u00ff&#39;)*
<br><br>thanks<br><br><br><br>Mark Proctor wrote:<br>&gt;<br>&gt; There is no regexp for this. Easiest thing to do is make a package with<br>&gt; a single rule in it and pass it into a packagebuilder session.<br>&gt;<br>&gt; Mark
<br>&gt; hypnosat7 wrote:<br>&gt;&gt; Hi,<br>&gt;&gt;&nbsp;&nbsp; When can I find the regular expression to check the validity of a rule<br>&gt;&gt; name ?<br>&gt;&gt; thanks<br>&gt;&gt;<br>&gt;<br>&gt; _______________________________________________
<br>&gt; rules-users mailing list<br>&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br>&gt;<br>&gt;<br><br>--<br>View this message in context: <a href="http://www.nabble.com/rule-name-regular-expression-tf4201280.html#a11959690">http://www.nabble.com/rule-name-regular-expression-tf4201280.html#a11959690
</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</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></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>