title: Regex to match Table of contents pattern
body: <p>Considering </p>
  
  <pre><code>NN = number/digit
  x = any single letter
  </code></pre>
  
  <p>I want to match these patterns: </p>
  
  <pre><code>1. NN
  2. NNx
  3. NN.NN
  4. NN.NNx
  5. NN.NN.NN
  6. NN.NN.NNx
  </code></pre>
  
  <p>Example that needs to be match:</p>
  
  <pre><code>1. 20
  2. 20a
  3. 20.20
  4. 20.20a
  5. 20.20.20
  6. 20.20.20a
  </code></pre>
  
  <p>Right now I am trying to use this regex: </p>
  
  <pre><code>\b\d+\.?\d+\.?\d+?[a-z]?\b
  </code></pre>
  
  <p>But if fails. </p>
  
  <p>Any help would be greatly appreciate, thanks! XD</p>
  
  <p>EDIT:</p>
  
  <p>I am matching this: </p>
  
  <pre><code>&lt;fn:footnote fr="10.23.20a"&gt;    (Just a sample)
  </code></pre>
  
  <p>Now I have a regex that will extract the '10.23.20a'</p>
  
  <p>Now I will check if this value will be valid, the 6 examples above will be the only string that will be accepted. </p>
  
  <p>This examples are invalid:</p>
  
  <pre><code>1. 20.a
  2. 20a.20.20
  3. etc.
  </code></pre>
  
  <p>Many thanks for your help men! :D</p>