title: Ruby populate 2 dim array dynamically
body: <p>I'm working on parser to analyze SQL code so trying to deal with all block comments. I come up with solution to process regex by index to see if it's inside comment block and for this purpose trying to fill 2 dim array in the code below where second element will be literal let say <strong>s</strong>. Not sure if this doable. I tried one gem but it failed.
  My goal to get array filled like</p>
  
  <p><code>all =[[9,'s'],[19,'s'],[24,'s']]</code><br>
  referring to example below. Final goal is to process legacy SQL code (a lot of it..) to find active lines with specific keywords.  Best </p>
  
  <pre><code>x = 'line:xss /*   */   /*   /*  CODE_Comment */  '
       puts x
  
      i = -1
      all = [[],[]]
      while i = x.index('/*',i+1)             
  do   all &lt;&lt; i   ####&lt;@&gt;&gt;&lt; how to add literal to second element ???
      end
      puts all  
  </code></pre>