hello i have 2 parent (or more ...) block and many child blocks inside them.
Block1 {
blockchild1 {
}
blockchild2 {
}
, ...
}
Block2 {
blockchild1 {
}
blockchild2 {
}
, ...
}
i want to use php regex and get first all parents blocks inside
([a-z-0-9]*)\s*[{](.*?)[}]
but this regex stop when arrive to first childblock close }
means first data receive is
Block1 {
blockchild1 {
}
but i want to get some thing like this
array 1 = Block1
array 2 = blockchild1 {
}
blockchild2 {
}
, ...
i want the regex pass child blocks [}]
and get everything inside of parents block. my regex is PCRE (PHP)