What is a good method for parsing an sql string into it separate components. I\'v tried with a regex, however I can\'t get it to work just right.
Say for instance:
I'd go for a sql parser that could be integrated to your language: don't reinvent the wheel.
I haven't used one in particular to recommend, but I'm sure that you can find one that do what you need.
See related: PHP MySQL SQL parser (INSERT and UPDATE)