title: How can I capture word by Regex
body: <p>I would like to capture the array key from a string.</p>
  
  <p>Here are my words: <code>message[0][generic][0][elements][0][default_action][url]...</code></p>
  
  <p>I want to capture the array keys after <code>message[0][generic][0][elements][0]</code>, and the expected results are <code>default_action</code> and <code>url</code> etc.</p>
  
  <p>I have tried following patterns but not work.</p>
  
  <ol>
  <li><code>message\[0\]\[generic\]\[0\]\[elements\]\[0\](?=\[(\w+)\])</code>: it captures <code>default_action</code> only;</li>
  <li><code>\[(\w+)\]</code>: it captures all array keys, but includes <code>0</code>, <code>generic</code>, <code>elements</code>...</li>
  </ol>
  
  <p>Is there any regex pattern for JavaScript that make the result array inverse, like <code>[url, default_action]</code>?</p>