http://qs321.pair.com?node_id=662894


in reply to need to parse firts part of SQL-query (regex question)

To expand on roboticus's comments - there is a SQL::Tokenize (I think that's the name) module on CPAN which works pretty well at tokenizing a SQL query. You could use that as a starting point.

Michael