I'm trying to write a regex script that will parse through HTML name attributes and return each nested array as a match. Here's an example:
<input type="text" name="contact[email]" />
<input type="text" name="contact[address][street]" />
I need some javascript regex that will parse those and match them in this way
Match 1: contact Match 2: email
Match 1: contact Match 2: address Match 3: street
Here's the current regex I have:
/(^.*?)(\[(.*?)\])?$/
Thanks!

nameattribute or on the entire string of HTML?