Version 2.2.2, Validation function for regex, fixes #17