tags:

views:

43

answers:

1

Anyone know of any re libraries out there to help parse columns, functions, and values from an SQL WHERE clause?

Example strings:

COLUMN=='VALUE'
COLUMN=='VALUE' AND COLUMN2='VALUE'
FUNCTION(COLUMN)==FUNCTION('VALUE')

I'm working in Python, but can port most anything over...

+1  A: 

Perhaps this SO question and its answers will help (Parsing SQL with Python).

Here are a couple of links that may help.

Oded
pyparsing seems to work great, thanks!
Lokkju