I do not know if this was asked before because English is not my first language, and I do not know the keywords to search.
So basically I have the following input element,
<input type="email" name="person[0].email" />
I would like to split the name into 3 parts, for example ["person", "0", "email"] .
I tried using /(\[[^[\]]])|\./ ( /(\[[^[\]]])|\./ , but it gives ["person", "[0]", "", undefined, "email"] . In addition, for a[0][1].b[3].c it should output ["a", "0", "1", "b", "3", "c"]
source share