in reply to Regexp for Mysql 5.1 join Problem
I would start from the OO-representation to transform it into the form you require.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law