title: Repeatable, complex regular expression, with dot '.' delimited separators
body: <p>I have a regular expression.  It contains a required named capture group, and some optional named capture groups.  It captures individual matches and parses the sections into the named groups which I need.</p>
  
  <p>Except, now I need it to repeat.</p>
  
  <p>Essentially, my regular expression represents an single atomic unit in a (potentially) much longer string.  Instead of matching my regex exactly, the target string will usually contain repeated instances of the regex, separated by the dot '.' character.</p>
  
  <p>For example, if this is what my regular expression captures: <code>&lt;some match&gt;</code></p>
  
  <p>The actual string could look like any of these:</p>
  
  <ul>
  <li><code>&lt;some match&gt;</code></li>
  <li><code>&lt;some match&gt;.&lt;some other match&gt;</code></li>
  <li><code>&lt;some match&gt;.&lt;some other match&gt;.&lt;yet another match&gt;</code></li>
  </ul>
  
  <p>What is the simplest way in which to modify the original regular expression, to account for the repeating patterns, while ignoring the dots?</p>
  
  <p>I'm not sure if it's actually needed, but here is the regular expression which I'm using to capture individual segments. Again, I'd like to enhance this to account for optional additional segments.  I'd like to have each segment appear as another "match" in the result set;</p>
  
  <pre><code>^(?&lt;member&gt;[A-Za-z_][A-Za-z0-9_]*)(?:\[(?&lt;index&gt;[0-9]+)\])?(?:\[(?&lt;index2&gt;[0-9]+)\])?(?:\[(?&lt;index3&gt;[0-9]+)\])?$
  </code></pre>
  
  <p>It is intended to parse a class path, with up to three optional index accessors. (i.e. "<code>member.sub_member[0].sub_sub_member[0][1][2]</code>")</p>
  
  <p>I suspect the answer involves look-ahead or look-behind, for which I am not entirely familiar.</p>
  
  <p>I currently use String.Split to separate string segments.  But I figure if the enhancement to the regex is simple enough, I skip the extra Split step, and re-use the regex as a validation mechanism, as well.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>As an additional wrench in the gears, I'd like to disallow any dot '.' character from the beginning or end of the string.  They should only exist as separators between path segments.</p>