Added validation and popover for valid patterns and error messages.