title: Regular expression for matching a variety of types of numbered lists
body: <p>I'd like to create a (PCRE) regular expression to match all commonly used numbered lists, and I'd like to share my thoughts and gather input on way to do this.</p>
  
  <p>I've defined 'lists' as the set of canonical Anglo-Saxon conventions, i.e.</p>
  
  <h3>Numbers</h3>
  
  <pre><code>1 2 3
  1. 2. 3.
  1) 2) 3)
  (1) (2) (3)
  1.1 1.2 1.2.1
  1.1. 1.2. 1.3.
  1.1) 1.2) 1.3)
  (1.1) (1.2) (1.3)
  </code></pre>
  
  <h3>Letters</h3>
  
  <pre><code>a b c
  a. b. c.
  a) b) c)
  (a) (b) (c) 
  A B C
  A. B. C. 
  A) B) C)
  (A) (B) (C)
  </code></pre>
  
  <h3>Roman numerals</h3>
  
  <pre><code>i ii iii
  i. ii. iii.
  i) ii) iii)
  (i) (ii) (iii)
  I II III
  i. ii. iii.
  i) ii) iii)
  (i) (ii) (iii)
  </code></pre>
  
  <p>I'd like to know how strong a set of list this is, and if there are other numbering conventions that should be in there, and if any of these ought to be removed.</p>
  
  <p>Here's a regular expression I've created to solve this problem (in <em>Python</em>):</p>
  
  <pre><code>numex = r'(?:\d{1,3}'\   # 1, 2, 3
      '(?:\.\d{1,3}){0,4}'\ # 1.1, 1.1.1.1
      '|[A-Z]{1,2}'\        # A. B. C.
      '|[ivxcl]{1,6}'       # i, iii, ...
  
  rex = re.compile(r'(\(?%s\)|%s\.?)' % numex, re.I) # re.U?
  
  rex.match("123. Some paragraph")    
  </code></pre>
  
  <p>I'd like to know how adequate this regex is for this problem, and if there are other alternative (regex or otherwise) solutions.</p>
  
  <p>Incidentally, for my particular use-case, I wouldn't expect list numbers of more than 25-50.</p>
  
  <p>Thank you for reading.</p>
  
  <p>Brian</p>