I have a string The quick brown {fox, dragon, dinosaur} jumps over the lazy {dog, cat, bear, {lion, tiger}}.
I want to get all string that are in between on curly braces. Curly braces inside curly braces must be ignored. The expected output in PHP array would be
[0] => fox, dragon, dinosaur
[1] => dog, cat, bear, {lion, tiger}
I tried this pattern \{([\s\S]*)\}
from Regex pattern extract string between curly braces and exclude curly braces answered by Mar but it seems this pattern get all string between curly braces without splitting non-related text (not sure the right word to use).
Here is the output of the pattern above
fox, jumps, over} over the lazy {dog, cat, bear, {lion, tiger}}
What is the best regex pattern to print the expected output from the sentence above?