i have looked at many regex charts and tutorials but i still cant get preg_match_all do what i need it to do.
i need to return this example:
param1,$config{}

from this string

$new_config{param1,$config{}}


note: none of the data in the string has anything to do with php

the hard part is that there can be many layers of ${}

this is what i came up with. i have very little regex knowledge so it is majorly messed up:

$regex = "@(^\$[a-zA-Z_]\{(.\s)*\}$)(?=(\$[a-zA-Z_]\{(.\s)*))@siu";

edit> what i meant was that i need to get all strings that match this:

$ALL_LETTERS_AND_UNDERSCORE{}
as long as it is not already inside of a match of the same expression.

so.
i want to return all of the containers that match the expression.

i coulnt edit because in the hour between the origional post and the edit, someone viewed it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.