in reply to Re^2: searching for multiple strings in a line
in thread searching for multiple strings in a line

One problem is that you can have multiple SELECT statements without having subselects, like so:

SELECT A, B FROM FOO WHERE ... UNION SELECT C as A, D as B FROM BAR WHERE ...

(Unless, of course, you consider the select statements as subselects of the union statement.) There may be other examples.

Depending on your needs, you may need a more exhaustive parser--SQL::Parser might assist, but I can't comment any further as I've never used it.

...roboticus