match expression. Urgent

Posted on 2004-10-06
Last Modified: 2006-11-17
I have a text with


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


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

Question by:eeolivier
  • 2
LVL 48

Accepted Solution

hernst42 earned 125 total points
ID: 12239330
preg_match_all works (depends on your regular expression)

preg_match_all('/\{[^}]+\}/U', $string, $matches)
LVL 48

Expert Comment

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


Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question