Please help, my regular expression skills do not give me the opportunity. I have the following line:
username|email_address|phone_numbers[number]profile[title|addresses[id]]
I want to be able to extract any data between square brackets, but not where this data is a subset of an already selected set. Therefore, any attachments should be left as part of the parent line.
In the above example, I would extract two parts:
"number" "title|addresses[id]"
Note that [id] is not retrieved as part of a lower level dataset.
I'm trying to do this with preg_match, but I think that I may have to resort to repeating each character in a string.
source share