title: using lua to parse code syntax?
body: <p>Suppose I have a string like so:</p>
  
  <blockquote>
    <p>the quick [color=brown]brown[/color] fox
    [color=green]jum[/color]p[color=yellow]e[/color]d over the lazy dog</p>
  </blockquote>
  
  <p>What's a good way of going through it and putting it all in an array where each time the text is within the bounds of a [color] tag it will have that color tag around it? so the word 'jumped' would look like this:</p>
  
  <pre><code>[color=green]j[/color]
  [color=green]u[/color]
  [color=green]m[/color]
  p
  [color=yellow]e[/color]
  d
  </code></pre>
  
  <p>Where each line is a new instance in the index.</p>
  
  <p>Currently I'm attempting to do it in what I believe is a really messy way by parsing it heavily...</p>