loosen regex to allow nested function calls in sql

this essentially is a recursive regex to ensure balanced parantheses