fixed message validation for regex