#PHP Heredoc syntax $regex = <<< END_OF_REGEX / [^ \"'`(),]*\([^)]*\) #match functions like concat(x,"y",`a`.`z`) or sum(`xyz`); |\([^)]*?\) #match grouped items |"[^"]*?" #match double quoted items |'[^']*?' #match single quoted items |`[A-Za-z0-9_ .'\"()+\\-&^%\$+?%\\/\\\\!`]+` #match backtick mysql names |[^ ,]+ #match keywords, operators and aliases |, /xi END_OF_REGEX;
EDIT: After some [Read more...]