I would like to find the content of all the outer square brackets pairs in a string.
If an outer pair has an inner pair then it should not be matched separately.
For example string: [abc][123][cde[456[aq[]1q1]]] results should be:
- abc
- 123
- cde[456[aq[]1q1]]
Any help will be highly appreciated...
using the most outer brackets always have a bracket next to them or end of string or start of string so this is essentially matching "[something]" if it's preceded by ^ or ] and has [ or $ after it.