title: Explain BNF syntax for NID in RFC 2141
body: <p>I am having trouble understanding some <a href="http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form" rel="nofollow noreferrer">BNF</a> syntax from <a href="https://www.rfc-editor.org/rfc/rfc2141" rel="nofollow noreferrer">RFC2141</a>.</p>
  <p>The line is <code>&lt;NID&gt; ::= &lt;let-num&gt; [ 1,31&lt;let-num-hyp&gt; ]</code>.  I think it means that <code>&lt;NID&gt;</code> is a symbol for a string, with constrained by two rules:</p>
  <ol>
  <li>The string must be begin with a single occurence of any of the <code>&lt;let-num&gt;</code> characters.</li>
  <li>This character may be followed by 0-31 occurrences* of any of the <code>&lt;let-num-hyp&gt;</code> characters.</li>
  </ol>
  <p>Am I reading this correctly?  Because, if I am, some of the implications are a bit confusing.</p>
  <p>*<em>equivalent to &quot;optionally, 1-31 occurrences</em></p>
  <p>The complete BNF syntax for a <code>&lt;NID&gt;</code> (Namespace Identifier) in <a href="https://www.rfc-editor.org/rfc/rfc2141" rel="nofollow noreferrer">RFC2141</a> is:</p>
  <pre><code>&lt;NID&gt;         ::= &lt;let-num&gt; [ 1,31&lt;let-num-hyp&gt; ]
  &lt;let-num-hyp&gt; ::= &lt;upper&gt; | &lt;lower&gt; | &lt;number&gt; | &quot;-&quot;
  &lt;let-num&gt;     ::= &lt;upper&gt; | &lt;lower&gt; | &lt;number&gt;
  &lt;upper&gt;       ::= &quot;A&quot; | &quot;B&quot; | &quot;C&quot; | &quot;D&quot; | &quot;E&quot; | &quot;F&quot; | &quot;G&quot; | &quot;H&quot; |
                    &quot;I&quot; | &quot;J&quot; | &quot;K&quot; | &quot;L&quot; | &quot;M&quot; | &quot;N&quot; | &quot;O&quot; | &quot;P&quot; |
                    &quot;Q&quot; | &quot;R&quot; | &quot;S&quot; | &quot;T&quot; | &quot;U&quot; | &quot;V&quot; | &quot;W&quot; | &quot;X&quot; |
                    &quot;Y&quot; | &quot;Z&quot;
  &lt;lower&gt;       ::= &quot;a&quot; | &quot;b&quot; | &quot;c&quot; | &quot;d&quot; | &quot;e&quot; | &quot;f&quot; | &quot;g&quot; | &quot;h&quot; |
                    &quot;i&quot; | &quot;j&quot; | &quot;k&quot; | &quot;l&quot; | &quot;m&quot; | &quot;n&quot; | &quot;o&quot; | &quot;p&quot; |
                    &quot;q&quot; | &quot;r&quot; | &quot;s&quot; | &quot;t&quot; | &quot;u&quot; | &quot;v&quot; | &quot;w&quot; | &quot;x&quot; |
                    &quot;y&quot; | &quot;z&quot;
  &lt;number&gt;      ::= &quot;0&quot; | &quot;1&quot; | &quot;2&quot; | &quot;3&quot; | &quot;4&quot; | &quot;5&quot; | &quot;6&quot; | &quot;7&quot; |
                    &quot;8&quot; | &quot;9&quot;
  </code></pre>