I have a string that holds the property and key values to accessing a value on an object..
For Example, the string is "property_name[key1][key2][key3]", which relates to $obj->property_name[key1][key2][key3]
I've been trying to parse the string with a regular expression, but all of my attempts have ben in vain.
So far, my regular expression looks like this, but it won't get key2.
^(\w+)\[([^\]]+)\](?:(\[([^\]]+)\])+)
Am I on the right track or is there a better way to do this that I should try?
Thanks.