Solved

match expression. Urgent

Posted on 2004-10-06
2
183 Views
Last Modified: 2006-11-17
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
0
Comment
Question by:eeolivier
  • 2
2 Comments
 
LVL 48

Accepted Solution

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

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

Expert Comment

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

      
      
0

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 (http://en.wikipedia.org/wiki/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