I'm making a system where users can enter they own expressions. I've searched all of the internet and I can't seem to find a sample of how I could validate the user entered expression before executing it.
Is there a "standard way" or "best practice" to validate user entered expressions or do I have to roll my own validation?
EDIT
I just want to allow a user to filter a table (array), so the expressions I guess wouldn't be overly complex.
so for an array with headers like array('id', 'firstName', 'lastName', 'docId', 'profit'); I'm expecting expressions like: row.id < 2 and row.profit <= 500