fixed regex and sql type error