Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: preg_replace - regex question
06-24-2005, 06:46 PM #1
- Join Date
- Jun 2005
- Thanked 0 Times in 0 Posts
preg_replace - regex question
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).
Last edited by devosc; 06-25-2005 at 12:04 PM. Reason: removed tia :)