If you have a little time for me, here is my problem:
Example string:
{= $test->{$test->test}(). "it's a test {"} Conscripti esse nobis sic belli sic ab rationem in provinciis. {= $test2->{$test2->test}(). "it's another test {"} Et questi et ex vincula rapti quos autem in Chilo.
Cogitabatur est et coeptantem consenuit praepotens per consulta ne praepositus. {= $test3}
{= $test->{$test->{$test->test}}(). "it's a test {"} Conscripti esse nobis sic belli sic ab rationem in provinciis. {= $test2->{$test2->test}(). "it's another test {" : {} } Et questi et ex vincula rapti quos autem in Chilo.
Cogitabatur est et coeptantem consenuit praepotens per consulta ne praepositus. {= $test3}
Example of the expected result with preg_match_all function :
- $test->{$test->test}(). "it's a test {"
- $test2->{$test2->test}(). "it's another test {"
- $test3
I need to find all between "{=" and "}" ; however, it may authorize :
- "{" surrounded by single quotes ' and double "
- "{}" as a pair is found
- bonus, multiline between "{=" and "}"
For the moment i use this expression : /{=(\? )?([^}]+)}/ but i can found inside { or }.
I try : /{=\s+ ( ({[^}]*}) | [^}]+ )[^}]*}/x but it's wrong result : http://www.phpliveregex.com/p/52p
Thank you for your help.
