diff --git a/libraries/src/Form/Rule/EmailRule.php b/libraries/src/Form/Rule/EmailRule.php index 1d2a85329f1c1..3187b83c376c9 100644 --- a/libraries/src/Form/Rule/EmailRule.php +++ b/libraries/src/Form/Rule/EmailRule.php @@ -31,9 +31,10 @@ class EmailRule extends FormRule * * @var string * @since 1.7.0 - * @link http://www.w3.org/TR/html-markup/input.email.html + * @link https://www.w3.org/TR/html/sec-forms.html#email-state-typeemail */ - protected $regex = "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$"; + protected $regex = "^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])" + . "?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$"; /** * Method to test the email address and optionally check for uniqueness.