Make sure regex stored is valid.