Skip to content
Snippets Groups Projects
Commit f142737b authored by Thomas Flori's avatar Thomas Flori
Browse files

Merge branch 'email-regex' into 'master'

allow upper case letters in domain part of emails and fix local part …

See merge request !23
parents 13eaf21e 835bf845
No related branches found
Tags v1.2.1
1 merge request!23allow upper case letters in domain part of emails and fix local part …
Pipeline #751 passed with stages
in 6 minutes and 23 seconds
...@@ -7,8 +7,8 @@ use Verja\Validator; ...@@ -7,8 +7,8 @@ use Verja\Validator;
class EmailAddress extends Validator class EmailAddress extends Validator
{ {
const LOCAL_PART_PATTERN = '[A-Za-z0-9.!#$%&\'*+-\/=?^_`{|}~.]+'; const LOCAL_PART_PATTERN = '[A-Za-z0-9.!#$%&\'*+\/=?^_`{|}~.-]+';
const DOMAIN_PART_PATTERN = '(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])'; const DOMAIN_PART_PATTERN = '[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:\.[a-zA-Z0-9]{2,}(?:-[a-zA-Z0-9]+)*)+';
/** {@inheritdoc} */ /** {@inheritdoc} */
public function validate($value, array $context = []): bool public function validate($value, array $context = []): bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment