Solved

match expression. Urgent

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now