Solved

match expression. Urgent

Posted on 2004-10-06
2
181 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

773 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