User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 373,364 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,632 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 246 | Replies: 1
Reply
Join Date: Mar 2007
Location: georgia
Posts: 55
Reputation: hunkychop is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 4
hunkychop's Avatar
hunkychop hunkychop is offline Offline
Junior Poster in Training

regex/preg_match_all help needed

  #1  
Mar 29th, 2008
i have looked at many regex charts and tutorials but i still cant get preg_match_all do what i need it to do.
i need to return this example:
param1,$config{}
from this string

$new_config{param1,$config{}}
note: none of the data in the string has anything to do with php

the hard part is that there can be many layers of ${}

this is what i came up with. i have very little regex knowledge so it is majorly messed up:
  1. $regex = "@(^\$[a-zA-Z_]\{(.\s)*\}$)(?=(\$[a-zA-Z_]\{(.\s)*))@siu";
toast
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2007
Location: georgia
Posts: 55
Reputation: hunkychop is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 4
hunkychop's Avatar
hunkychop hunkychop is offline Offline
Junior Poster in Training

Re: regex/preg_match_all help needed

  #2  
Mar 29th, 2008
edit> what i meant was that i need to get all strings that match this:

$ALL_LETTERS_AND_UNDERSCORE{}
as long as it is not already inside of a match of the same expression.

so.
i want to return all of the containers that match the expression.

i coulnt edit because in the hour between the origional post and the edit, someone viewed it.
toast
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Other Threads in the PHP Forum

All times are GMT -4. The time now is 2:43 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC