in reply to parse a query string

Is there any particular reason why you're not using existing solutions such as SQL::Parser ?

If there are (?), then what you need to do is parse the thing from left to right, collecting parts as you go, instead of trying to parse it all at once. A recursive algorithm would be good, or you could just go use existing parser-creators, like Parse::RecDescent or Parse::Yapp.

C.

Replies are listed 'Best First'.
Re^2: parse a query string
by ctaustin (Sexton) on Jul 06, 2005 at 13:00 UTC
    I am going to executing this through DBI. I needed the column aliases to write out to a flat file for use by a third party application. This application is very picky about column headings forcing us to use aliases. I didn't know about  $sth->{NAME_lc}, I will look into that now.