should we validate that the pattern is a valid regex to throw an exception to the user in such case rather than having him try to understand why the regex does not match ? See http://3v4l.org/YThvg for a validation of the pattern being a valid regex