try
{
Pattern pattern = Pattern.compile(req.regexp());
Matcher matcher = pattern.matcher(stringField);
if (!matcher.matches())
errors.rejectValue(field.getName(), errorCodes[1], req.regexp());
}
catch (Exception ex)
{
if (log.isDebugEnabled()) log.debug("Error validating " + field, ex);
}