class Kemal::FormValidator::Email

Overview

Kemal::FormValidator::Email validates that the input is a valid email. The regex pattern used to validate the email is a non-strict pattern meaning that it only catches common typo errors. However, it is possible to specify another, more strict, pattern if needed.

Kemal::FormValidator::Email.new
Kemal::FormValidator::Email.new(/custom-validation-pattern/)

Defined in:

kemal-form/validators.cr

Constructors

Instance Method Summary

Instance methods inherited from class Kemal::FormValidator::Validator

validate(field : Kemal::Form::Field) validate

Constructor Detail

def self.new(pattern : Regex = /^\S+@\S+\.\S+$/, message : String = "Field must be a valid email") #

[View source]

Instance Method Detail

def validate(field : Kemal::Form::Field) #

[View source]