I'm having some trouble with regular expressions. I'm making an application that parses an SQL query, and I want to add a certain table name to every field in the query.
I want something such as
CONCAT('blah', field)
to become
CONCAT('blah', table.field)
The trick is getting it to only replace values that aren't within single quotes and aren't a function (doesn't have an appended parentheses).
Anyone have any ideas?