Fixes #3683: check that the regexp is valid before doing the release