Allows to match exception message using a regular expression.