...

View Full Version : preg_replace - regex question



devosc
06-24-2005, 06:46 PM
Hi,

Have a query string similiar to the below:

$str = 'select * from :table_categories_description left join :table_categories using (id) where ...'


Is there a rexp that will do _five_ matches and replace with a given value, the values to replace on are if the character after the token e.g. ':table_categories' is in the set[ ,)"], e.g either a whitespace, comma, close parenthesis,double-quote, or that the token is at the very end of the given $str string. Basically trying to match and replace either the five types of occurances with one call (without changing things like ':table_categories_description' etc).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum