Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    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 :)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts