I need a regex in php that allows the following:
here is the given example
1. aaa aaa{bb b {c cc}{d dd}e ee}xxx
2. 123{asd{asd{asd{asd}asd}}asd}qwe
the output will be:
1. {bb b {c cc}{d dd}e ee}
2. {asd{asd{asd{asd}asd}}asd}
I tried this but does not work
preg_match_all('/{(.*?)}/', $resonse, $matches);
its basically getting rid of anything outside the main curly braces eventhought there are curly braces inside of it. I really need you help. thanks so much.
You will need PCRE’s recursion capabilities to do this.
prints