match expression. Urgent

I have a text with

{TEST1}+{TEST2}*{TEST4}

I want to retreive the name beetween the "{" and get an array with

TEST1, TEST2, TEST4.

with preg_match all, i can't do that because it take for exemple TEST1}+{TEST2}*{TEST4

Help
eeolivierAsked:
Who is Participating?
 
hernst42Connect With a Mentor Commented:
preg_match_all works (depends on your regular expression)

try:
preg_match_all('/\{[^}]+\}/U', $string, $matches)
0
 
hernst42Commented:
upd forgot () around
preg_match_all('/\{([^}]+)\}/U', $string, $matches)

      
      
0
All Courses

From novice to tech pro — start learning today.