MySQL does not support ? in regex

This will not work in all cases but at least it makes MySQL work again. I'll merge this in and we are going to fix this properly later.