Not sure exactly what you're asking. Can you clarify, or give an example? Do you want to pass in a list of names and have it convert the WHERE to name in (name_a, name_b, ...) ? and you need to specify the RDBMS, Regex support is different between them.
–
Mark BradyNov 21 '08 at 5:17

2 Answers
2

SELECT * FROM authors WHERE name = @name_param
AND string = 'don\'t use @name_param';

How would the regular expression know to use the first @name_param but not the second?

It's a problem that can be solved, but it's not practical to do it in a single regular expression. I had to handle this in Zend_Db, and what I did was first strip out all quoted strings and delimited identifiers, and then you can use regular expressions on the remainder.