@@ -7,7 +7,7 @@ cast to a string before being validated.
7
7
+----------------+---------------------------------------------------------------------+
8
8
| Applies to | :ref: `property or method <validation-property-target >` |
9
9
+----------------+---------------------------------------------------------------------+
10
- | Options | - `strict `_ |
10
+ | Options | - `mode `_ |
11
11
| | - `message `_ |
12
12
| | - `checkMX `_ |
13
13
| | - `checkHost `_ |
@@ -91,14 +91,34 @@ Basic Usage
91
91
Options
92
92
-------
93
93
94
+ mode
95
+ ~~~~
96
+
97
+ **type **: ``string `` **default **: ``loose ``
98
+
99
+ This option is optional and defines the pattern the email address is validated against.
100
+ Valid values are:
101
+
102
+ * ``loose ``
103
+ * ``strict ``
104
+ * ``html5 ``
105
+
106
+ loose
107
+ .....
108
+
109
+ A simple regular expression. Allows all values with an "@" symbol in, and a "."
110
+ in the second host part of the email address.
111
+
94
112
strict
95
- ~~~~~~
113
+ ......
96
114
97
- **type **: ``boolean `` **default **: ``false ``
115
+ Uses the `egulias/email-validator `_ library to perform an RFC compliant
116
+ validation. You will need to install that library to use this mode.
117
+
118
+ html5
119
+ .....
98
120
99
- When false, the email will be validated against a simple regular expression.
100
- If true, then the `egulias/email-validator `_ library is required to perform
101
- an RFC compliant validation.
121
+ This matches the pattern used for the `HTML5 email input element `_.
102
122
103
123
message
104
124
~~~~~~~
@@ -127,3 +147,4 @@ of the given email.
127
147
.. include :: /reference/constraints/_payload-option.rst.inc
128
148
129
149
.. _egulias/email-validator : https://packagist.org/packages/egulias/email-validator
150
+ .. _HTML5 email input element : https://www.w3.org/TR/html5/sec-forms.html#email-state-typeemail
0 commit comments