title: PHP Regular Expression to match `name[50]` to the "name" and "50" values
body: <p>I'm looking for some more regular expression help, to work with the PHP function <code>preg_match</code>. I need to match the following strings;</p>
  
  <ul>
  <li><code>string[50]</code></li>
  <li><code>string</code></li>
  </ul>
  
  <p>Ideally the array returned would be something like this;</p>
  
  <ul>
  <li><code>string</code>, <code>50</code></li>
  <li><code>string</code></li>
  </ul>
  
  <p>Any help would be appreciated :-)
  This was what I came up with but it doesn't remotely do what I expected with my little regex knowledge! <code>/([a-z])+(\[[0-9]\])?/i</code></p>